(function($){ "use strict"; jQuery(document).ready(function($){ $('body').on('click','.nectar-love', function(){ var $loveLink=$(this); var $id=$(this).attr('id'); var $that=$(this); if($loveLink.hasClass('loved')) return false; if($(this).hasClass('inactive')) return false; var $dataToPass={ action: 'nectar-love', loves_id: $id } $.post(nectarLove.ajaxurl,$dataToPass, function(data){ $loveLink.find('span').html(data); $loveLink.addClass('loved').attr('title','You already love this!'); $loveLink.find('span').css({'opacity': 1,'width':'auto'}); }); $(this).addClass('inactive'); return false; }); }); })(jQuery); !function(d,l){"use strict";var e=!1,o=!1;if(l.querySelector)if(d.addEventListener)e=!0;if(d.wp=d.wp||{},!d.wp.receiveEmbedMessage)if(d.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){var r,a,i,s,n,o=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),c=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]');for(r=0;rloading tweets...' }); }); };} if('function'!==typeof(window[ 'vc_googleplus' ])){ window.vc_googleplus=function (){ if(0 < jQuery('.wpb_googleplus').length){ (function (){ var po=document.createElement('script'); po.type='text/javascript'; po.async=true; po.src='https://apis.google.com/js/plusone.js'; var s=document.getElementsByTagName('script')[ 0 ]; s.parentNode.insertBefore(po, s); })(); }} } if('function'!==typeof(window[ 'vc_pinterest' ])){ window.vc_pinterest=function (){ if(0 < jQuery('.wpb_pinterest').length){ (function (){ var po=document.createElement('script'); po.type='text/javascript'; po.async=true; po.src='http://assets.pinterest.com/js/pinit.js'; var s=document.getElementsByTagName('script')[ 0 ]; s.parentNode.insertBefore(po, s); })(); }} } if('function'!==typeof(window[ 'vc_progress_bar' ])){ window.vc_progress_bar=function (){ if('undefined'!==typeof(jQuery.fn.waypoint)){ jQuery('.vc_progress_bar').waypoint(function (){ jQuery(this).find('.vc_single_bar').each(function(index){ var $this=jQuery(this), bar=$this.find('.vc_bar'), val=bar.data('percentage-value'); setTimeout(function (){ bar.css({ "width": val + '%' }); }, index * 200); }); }, { offset: '85%' }); }} } if('function'!==typeof(window[ 'vc_waypoints' ])){ window.vc_waypoints=function (){ if('undefined'!==typeof(jQuery.fn.waypoint)){ jQuery('.wpb_animate_when_almost_visible:not(.wpb_start_animation)').waypoint(function (){ jQuery(this).addClass('wpb_start_animation'); }, { offset: '85%' }); }} } if('function'!==typeof(window[ 'vc_toggleBehaviour' ])){ window.vc_toggleBehaviour=function($el){ function event(e){ e&&e.preventDefault&&e.preventDefault(); var title=jQuery(this); var element=title.closest('.vc_toggle'); var content=element.find('.vc_toggle_content'); if(element.hasClass('vc_toggle_active')){ content.slideUp({ duration: 300, complete: function (){ element.removeClass('vc_toggle_active'); }}); }else{ content.slideDown({ duration: 300, complete: function (){ element.addClass('vc_toggle_active'); }}); }} if($el){ if($el.hasClass('vc_toggle_title')){ $el.unbind('click').click(event); }else{ $el.find(".vc_toggle_title").unbind('click').click(event); }}else{ jQuery(".vc_toggle_title").unbind('click').on('click', event); }} } if('function'!==typeof(window[ 'vc_tabsBehaviour' ])){ window.vc_tabsBehaviour=function($tab){ if(jQuery.ui){ var $call=$tab||jQuery('.wpb_tabs, .wpb_tour'), ver=jQuery.ui&&jQuery.ui.version ? jQuery.ui.version.split('.'):'1.10', old_version=1===parseInt(ver[ 0 ])&&9 > parseInt(ver[ 1 ]); $call.each(function(index){ var $tabs, interval=jQuery(this).attr("data-interval"), tabs_array=[]; $tabs=jQuery(this).find('.wpb_tour_tabs_wrapper').tabs({ show: function(event, ui){ wpb_prepare_tab_content(event, ui); }, beforeActivate: function(event, ui){ 1!==ui.newPanel.index()&&ui.newPanel.find('.vc_pie_chart:not(.vc_ready)'); }, activate: function(event, ui){ wpb_prepare_tab_content(event, ui); }}); if(interval&&0 < interval){ try { $tabs.tabs('rotate', interval * 1000); } catch(e){ window.console&&window.console.log&&console.log(e); }} jQuery(this).find('.wpb_tab').each(function (){ tabs_array.push(this.id); }); jQuery(this).find('.wpb_tabs_nav li').click(function(e){ e.preventDefault(); if(old_version){ $tabs.tabs("select", jQuery('a', this).attr('href')); }else{ $tabs.tabs("option", "active", jQuery(this).index()); } return false; }); jQuery(this).find('.wpb_prev_slide a, .wpb_next_slide a').click(function(e){ e.preventDefault(); if(old_version){ var index=$tabs.tabs('option', 'selected'); if(jQuery(this).parent().hasClass('wpb_next_slide')){ index ++; }else{ index --; } if(0 > index){ index=$tabs.tabs("length") - 1; } else if(index >=$tabs.tabs("length")){ index=0; } $tabs.tabs("select", index); }else{ var index=$tabs.tabs("option", "active"), length=$tabs.find('.wpb_tab').length; if(jQuery(this).parent().hasClass('wpb_next_slide')){ index=(index + 1) >=length ? 0:index + 1; }else{ index=0 > index - 1 ? length - 1:index - 1; } $tabs.tabs("option", "active", index); }}); }); }} } if('function'!==typeof(window[ 'vc_accordionBehaviour' ])){ window.vc_accordionBehaviour=function (){ jQuery('.wpb_accordion').each(function(index){ var $this=jQuery(this); var $tabs, interval=$this.attr("data-interval"), active_tab = ! isNaN(jQuery(this).data('active-tab'))&&0 < parseInt($this.data('active-tab')) ? parseInt($this.data('active-tab')) - 1:false, collapsible=false===active_tab||'yes'===$this.data('collapsible'); $tabs=$this.find('.wpb_accordion_wrapper').accordion({ header: "> div > h3", autoHeight: false, heightStyle: "content", active: active_tab, collapsible: collapsible, navigation: true, activate: vc_accordionActivate, change: function(event, ui){ if('undefined'!==typeof(jQuery.fn.isotope)){ ui.newContent.find('.isotope').isotope("layout"); } vc_carouselBehaviour(ui.newPanel); }}); if(true===$this.data('vcDisableKeydown')){ $tabs.data('uiAccordion')._keydown=function (){ };}}); }} if('function'!==typeof(window[ 'vc_teaserGrid' ])){ window.vc_teaserGrid=function (){ var layout_modes={ fitrows: 'fitRows', masonry: 'masonry' }; jQuery('.wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)').each(function (){ var $container=jQuery(this); var $thumbs=$container.find('.wpb_thumbnails'); var layout_mode=$thumbs.attr('data-layout-mode'); $thumbs.isotope({ itemSelector: '.isotope-item', layoutMode: ('undefined'===typeof(layout_modes[ layout_mode ]) ? 'fitRows':layout_modes[ layout_mode ]) }); $container.find('.categories_filter a').data('isotope', $thumbs).click(function(e){ e.preventDefault(); var $thumbs=jQuery(this).data('isotope'); jQuery(this).parent().parent().find('.active').removeClass('active'); jQuery(this).parent().addClass('active'); $thumbs.isotope({ filter: jQuery(this).attr('data-filter') }); }); jQuery(window).bind('load resize', function (){ $thumbs.isotope("layout"); }); }); }} if('function'!==typeof(window[ 'vc_carouselBehaviour' ])){ window.vc_carouselBehaviour=function($parent){ var $carousel=$parent ? $parent.find(".wpb_carousel"):jQuery(".wpb_carousel"); $carousel.each(function (){ var $this=jQuery(this); if(true!==$this.data('carousel_enabled')&&$this.is(':visible')){ $this.data('carousel_enabled', true); var visible_count=getColumnsCount(jQuery(this)), carousel_speed=500; if(jQuery(this).hasClass('columns_count_1')){ carousel_speed=900; } var carousele_li=jQuery(this).find('.wpb_thumbnails-fluid li'); carousele_li.css({ "margin-right": carousele_li.css("margin-left"), "margin-left": 0 }); jQuery(this).find('.wpb_wrapper:eq(0)').jCarouselLite({ btnNext: jQuery(this).find('.next'), btnPrev: jQuery(this).find('.prev'), visible: visible_count, speed: carousel_speed }) .width('100%'); var fluid_ul=jQuery(this).find('ul.wpb_thumbnails-fluid'); fluid_ul.width(fluid_ul.width() + 300); jQuery(window).resize(function (){ var before_resize=screen_size; screen_size=getSizeName(); if(before_resize!=screen_size){ window.setTimeout('location.reload()', 20); }}); }}); }} if('function'!==typeof(window[ 'vc_slidersBehaviour' ])){ window.vc_slidersBehaviour=function (){ jQuery('.wpb_gallery_slides').each(function(index){ var this_element=jQuery(this); var $imagesGrid; if(this_element.hasClass('wpb_slider_nivo')){ var sliderSpeed=800, sliderTimeout=this_element.attr('data-interval') * 1000; if(0===sliderTimeout){ sliderTimeout=9999999999; } this_element.find('.nivoSlider').nivoSlider({ effect: 'boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse', slices: 15, boxCols: 8, boxRows: 4, animSpeed: sliderSpeed, pauseTime: sliderTimeout, startSlide: 0, directionNav: true, directionNavHide: true, controlNav: true, keyboardNav: false, pauseOnHover: true, manualAdvance: false, prevText: 'Prev', nextText: 'Next' }); } else if(this_element.hasClass('wpb_image_grid')){ if(jQuery.fn.imagesLoaded){ $imagesGrid=this_element.find('.wpb_image_grid_ul').imagesLoaded(function (){ $imagesGrid.isotope({ itemSelector: '.isotope-item', layoutMode: 'fitRows' }); }); }else{ this_element.find('.wpb_image_grid_ul').isotope({ itemSelector: '.isotope-item', layoutMode: 'fitRows' }); }} }); }} if('function'!==typeof(window[ 'vc_prettyPhoto' ])){ window.vc_prettyPhoto=function (){ try { if(jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto){ jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({ animationSpeed: 'normal', padding: 15, opacity: 0.7, showTitle: true, allowresize: true, counter_separator_label: '/', hideflash: false, deeplinking: false, modal: false, callback: function (){ var url=location.href; var hashtag=(url.indexOf('#!prettyPhoto')) ? true:false; if(hashtag){ location.hash="!"; }} , social_tools: '' }); }} catch(err){ window.console&&window.console.log&&console.log(err); }} } if('function'!==typeof(window[ 'vc_google_fonts' ])){ window.vc_google_fonts=function (){ return false; }} window.vcParallaxSkroll=false; if('function'!==typeof(window[ 'vc_rowBehaviour' ])){ window.vc_rowBehaviour=function (){ var $=window.jQuery; function localFunction(){ var $elements=$('[data-vc-full-width="true"]'); $.each($elements, function(key, item){ var $el=$(this); $el.addClass('vc_hidden'); var $el_full=$el.next('.vc_row-full-width'); var el_margin_left=parseInt($el.css('margin-left'), 10); var el_margin_right=parseInt($el.css('margin-right'), 10); var offset=0 - $el_full.offset().left - el_margin_left; var width=$(window).width(); $el.css({ 'position': 'relative', 'left': offset, 'box-sizing': 'border-box', 'width': $(window).width() }); if(! $el.data('vcStretchContent')){ var padding=(- 1 * offset); if(0 > padding){ padding=0; } var paddingRight=width - padding - $el_full.width() + el_margin_left + el_margin_right; if(0 > paddingRight){ paddingRight=0; } $el.css({ 'padding-left': padding + 'px', 'padding-right': paddingRight + 'px' }); } $el.attr("data-vc-full-width-init", "true"); $el.removeClass('vc_hidden'); }); } function parallaxRow(){ var vcSkrollrOptions, vcParallaxSkroll, callSkrollInit=false; if(vcParallaxSkroll){ vcParallaxSkroll.destroy(); } $('.vc_parallax-inner').remove(); $('[data-5p-top-bottom]').removeAttr('data-5p-top-bottom data-30p-top-bottom'); $('[data-vc-parallax]').each(function (){ var skrollrSpeed, skrollrSize, skrollrStart, skrollrEnd, $parallaxElement, parallaxImage, youtubeId; callSkrollInit=true; if('on'===$(this).data('vcParallaxOFade')){ $(this).children().attr('data-5p-top-bottom', 'opacity:0;').attr('data-30p-top-bottom', 'opacity:1;'); } skrollrSize=$(this).data('vcParallax') * 100; $parallaxElement=$('
').addClass('vc_parallax-inner').appendTo($(this)); $parallaxElement.height(skrollrSize + '%'); parallaxImage=$(this).data('vcParallaxImage'); youtubeId=vcExtractYoutubeId(parallaxImage); if(youtubeId){ insertYoutubeVideoAsBackground($parallaxElement, youtubeId); }else if('undefined'!==typeof(parallaxImage)){ $parallaxElement.css('background-image', 'url(' + parallaxImage + ')'); } skrollrSpeed=skrollrSize - 100; skrollrStart=- skrollrSpeed; skrollrEnd=0; $parallaxElement.attr('data-bottom-top', 'top: ' + skrollrStart + '%;').attr('data-top-bottom', 'top: ' + skrollrEnd + '%;'); }); if(callSkrollInit&&window.skrollr){ vcSkrollrOptions={ forceHeight: false, smoothScrolling: false, mobileCheck: function (){ return false; }}; vcParallaxSkroll=skrollr.init(vcSkrollrOptions); return vcParallaxSkroll; } return false; } function fullHeightRow(){ $('.vc_row-o-full-height:first').each(function (){ var $window, windowHeight, offsetTop, fullHeight; $window=$(window); windowHeight=$window.height(); offsetTop=$(this).offset().top; if(offsetTop < windowHeight){ fullHeight=100 - offsetTop / (windowHeight / 100); $(this).css('min-height', fullHeight + 'vh'); }}); $('.vc_row-o-full-height.vc_row-o-content-middle').each(function (){ var elHeight=$(this).height(); $('
') .addClass('vc_row-full-height-fixer') .height(elHeight) .prependTo($(this)); }); } $(window).unbind('resize.vcRowBehaviour').bind('resize.vcRowBehaviour', localFunction); $(window).bind('resize.vcRowBehaviour', fullHeightRow); localFunction(); fullHeightRow(); initVideoBackgrounds(); parallaxRow(); }} if('function'!==typeof(window[ 'vc_gridBehaviour' ])){ window.vc_gridBehaviour=function (){ jQuery.fn.vcGrid&&jQuery('[data-vc-grid]').vcGrid(); }} if('function'!==typeof(window[ 'getColumnsCount' ])){ window.getColumnsCount=function(el){ var find=false, i=1; while(false===find){ if(el.hasClass('columns_count_' + i)){ find=true; return i; } i ++; }} } var screen_size=getSizeName(); function getSizeName(){ var screen_w=jQuery(window).width(); if(1170 < screen_w){ return 'desktop_wide'; } if(960 < screen_w&&1169 > screen_w){ return 'desktop'; } if(768 < screen_w&&959 > screen_w){ return 'tablet'; } if(300 < screen_w&&767 > screen_w){ return 'mobile'; } if(300 > screen_w){ return 'mobile_portrait'; } return ''; } function loadScript(url, $obj, callback){ var script=document.createElement("script"); script.type="text/javascript"; if(script.readyState){ script.onreadystatechange=function (){ if("loaded"===script.readyState || "complete"===script.readyState){ script.onreadystatechange=null; callback(); }};}else{ } script.src=url; $obj.get(0).appendChild(script); } if('function'!==typeof(window[ 'wpb_prepare_tab_content' ])){ window.wpb_prepare_tab_content=function(event, ui){ var panel=ui.panel||ui.newPanel, $pie_charts=panel.find('.vc_pie_chart:not(.vc_ready)'), $round_charts=panel.find('.vc_round-chart'), $line_charts=panel.find('.vc_line-chart'), $carousel=panel.find('[data-ride="vc_carousel"]'), $ui_panel, $google_maps; vc_carouselBehaviour(); vc_plugin_flexslider(panel); if(ui.newPanel.find('.vc_masonry_media_grid, .vc_masonry_grid').length){ ui.newPanel.find('.vc_masonry_media_grid, .vc_masonry_grid').each(function (){ var grid=jQuery(this).data('vcGrid'); grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry(); }); } if(panel.find('.vc_masonry_media_grid, .vc_masonry_grid').length){ panel.find('.vc_masonry_media_grid, .vc_masonry_grid').each(function (){ var grid=jQuery(this).data('vcGrid'); grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry(); }); } $pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(); $round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({ reload: false }); $line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({ reload: false }); $carousel.length&&jQuery.fn.carousel&&$carousel.carousel('resizeAction'); $ui_panel=panel.find('.isotope, .wpb_image_grid_ul'); $google_maps=panel.find('.wpb_gmaps_widget'); if(0 < $ui_panel.length){ $ui_panel.isotope("layout"); } if($google_maps.length&&! $google_maps.is('.map_ready')){ var $frame=$google_maps.find('iframe'); $frame.attr('src', $frame.attr('src')); $google_maps.addClass('map_ready'); } if(panel.parents('.isotope').length){ panel.parents('.isotope').each(function (){ jQuery(this).isotope("layout"); }); }} } function vc_ttaActivation(){ jQuery('[data-vc-accordion]').on('show.vc.accordion', function(e){ var $=window.jQuery, ui={}; ui.newPanel=$(this).data('vc.accordion').getTarget(); window.wpb_prepare_tab_content(e, ui); }); } function vc_accordionActivate(event, ui){ if(ui.newPanel.length&&ui.newHeader.length){ var $pie_charts=ui.newPanel.find('.vc_pie_chart:not(.vc_ready)'), $round_charts=ui.newPanel.find('.vc_round-chart'), $line_charts=ui.newPanel.find('.vc_line-chart'), $carousel=ui.newPanel.find('[data-ride="vc_carousel"]'); if('undefined'!==typeof(jQuery.fn.isotope)){ ui.newPanel.find('.isotope, .wpb_image_grid_ul').isotope("layout"); } if(ui.newPanel.find('.vc_masonry_media_grid, .vc_masonry_grid').length){ ui.newPanel.find('.vc_masonry_media_grid, .vc_masonry_grid').each(function (){ var grid=jQuery(this).data('vcGrid'); grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry(); }); } vc_carouselBehaviour(ui.newPanel); vc_plugin_flexslider(ui.newPanel); $pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(); $round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({ reload: false }); $line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({ reload: false }); $carousel.length&&jQuery.fn.carousel&&$carousel.carousel('resizeAction'); if(ui.newPanel.parents('.isotope').length){ ui.newPanel.parents('.isotope').each(function (){ jQuery(this).isotope("layout"); }); }} } function initVideoBackgrounds(){ jQuery('.vc_row').each(function (){ var $row=jQuery(this), youtubeUrl, youtubeId; if($row.data('vcVideoBg')){ youtubeUrl=$row.data('vcVideoBg'); youtubeId=vcExtractYoutubeId(youtubeUrl); if(youtubeId){ $row.find('.vc_video-bg').remove(); insertYoutubeVideoAsBackground($row, youtubeId); } jQuery(window).on('grid:items:added', function(event, $grid){ if(! $row.has($grid).length){ return; } vcResizeVideoBackground($row); }); }else{ $row.find('.vc_video-bg').remove(); }}); } function insertYoutubeVideoAsBackground($element, youtubeId, counter){ if('undefined'===typeof(YT.Player)){ counter='undefined'===typeof(counter) ? 0:counter; if(100 < counter){ console.warn('Too many attempts to load YouTube api'); return; } setTimeout(function (){ insertYoutubeVideoAsBackground($element, youtubeId, counter ++); }, 100); return; } var $container=$element.prepend('
').find('.inner'); new YT.Player($container[ 0 ], { width: '100%', height: '100%', videoId: youtubeId, playerVars: { playlist: youtubeId, iv_load_policy: 3, enablejsapi: 1, disablekb: 1, autoplay: 1, controls: 0, showinfo: 0, rel: 0, loop: 1 }, events: { onReady: function(event){ event.target.mute().setLoop(true); }} }); vcResizeVideoBackground($element); jQuery(window).bind('resize', function (){ vcResizeVideoBackground($element); }); } function vcResizeVideoBackground($element){ var iframeW, iframeH, marginLeft, marginTop, containerW=$element.innerWidth(), containerH=$element.innerHeight(), ratio1=16, ratio2=9; if(( containerW / containerH) <(ratio1 / ratio2)){ iframeW=containerH * (ratio1 / ratio2); iframeH=containerH; marginLeft=- Math.round(( iframeW - containerW) / 2) + 'px'; marginTop=- Math.round(( iframeH - containerH) / 2) + 'px'; iframeW +='px'; iframeH +='px'; }else{ iframeW=containerW; iframeH=containerW * (ratio2 / ratio1); marginTop=- Math.round(( iframeH - containerH) / 2) + 'px'; marginLeft=- Math.round(( iframeW - containerW) / 2) + 'px'; iframeW +='px'; iframeH +='px'; } $element.find('.vc_video-bg iframe').css({ maxWidth: '1000%', marginLeft: marginLeft, marginTop: marginTop, width: iframeW, height: iframeH }); } function vcExtractYoutubeId(url){ if('undefined'===typeof(url)){ return false; } var id=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/); if(null!==id){ return id[ 1 ]; } return false; }; (function($){ $.prettyPhoto={version: '3.1.6'}; $.fn.prettyPhoto=function(pp_settings){ pp_settings=jQuery.extend({ hook: 'rel', animation_speed: 'fast', ajaxcallback: function(){}, slideshow: 5000, autoplay_slideshow: false, opacity: 0.80, show_title: true, allow_resize: true, allow_expand: true, default_width: 500, default_height: 344, counter_separator_label: '/', theme: 'pp_default', horizontal_padding: 20, hideflash: false, wmode: 'opaque', autoplay: true, modal: false, deeplinking: true, overlay_gallery: true, overlay_gallery_max: 30, keyboard_shortcuts: true, changepicturecallback: function(){}, callback: function(){}, ie6_fallback: true, markup: '
\
 
\
\
\
\
\
\
\
\
\
\
\
\ Expand \
\ next \ previous \
\
\
\
\ Previous \

0/0

\ Next \
\

\
{pp_social}
\ Close \
\
\
\
\
\
\
\
\
\
\
\
\
', gallery_markup: '', image_markup: '', flash_markup: '', quicktime_markup: '', iframe_markup: '', inline_markup: '
{content}
', custom_markup: '', social_tools: '' }, pp_settings); var matchedObjects=this, percentBased=false, pp_dimensions, pp_open, pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth, windowHeight=$(window).height(), windowWidth=$(window).width(), pp_slideshow; doresize=true, scroll_pos=_get_scroll(); $(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){ _center_overlay(); _resize_overlay(); }); if(pp_settings.keyboard_shortcuts){ $(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){ if(typeof $pp_pic_holder!='undefined'){ if($pp_pic_holder.is(':visible')){ switch(e.keyCode){ case 37: $.prettyPhoto.changePage('previous'); e.preventDefault(); break; case 39: $.prettyPhoto.changePage('next'); e.preventDefault(); break; case 27: if(!settings.modal) $.prettyPhoto.close(); e.preventDefault(); break; };}; };}); }; $.prettyPhoto.initialize=function(){ settings=pp_settings; if(settings.theme=='pp_default') settings.horizontal_padding=16; theRel=$(this).attr(settings.hook); galleryRegExp=/\[(?:.*)\]/; isSet=(galleryRegExp.exec(theRel)) ? true:false; pp_images=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return $(n).attr('href'); }):$.makeArray($(this).attr('href')); pp_titles=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt'):""; }):$.makeArray($(this).find('img').attr('alt')); pp_descriptions=(isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel)!=-1) return ($(n).attr('title')) ? $(n).attr('title'):""; }):$.makeArray($(this).attr('title')); if(pp_images.length > settings.overlay_gallery_max) settings.overlay_gallery=false; set_position=jQuery.inArray($(this).attr('href'), pp_images); rel_index=(isSet) ? set_position:$("a["+settings.hook+"^='"+theRel+"']").index($(this)); _build_overlay(this); if(settings.allow_resize) $(window).bind('scroll.prettyphoto',function(){ _center_overlay(); }); $.prettyPhoto.open(); return false; } $.prettyPhoto.open=function(event){ if(typeof settings=="undefined"){ settings=pp_settings; pp_images=$.makeArray(arguments[0]); pp_titles=(arguments[1]) ? $.makeArray(arguments[1]):$.makeArray(""); pp_descriptions=(arguments[2]) ? $.makeArray(arguments[2]):$.makeArray(""); isSet=(pp_images.length > 1) ? true:false; set_position=(arguments[3])? arguments[3]: 0; _build_overlay(event.target); } if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden'); _checkPosition($(pp_images).size()); $('.pp_loaderIcon').show(); if(settings.deeplinking) setHashtag(); if(settings.social_tools){ facebook_like_link=settings.social_tools.replace('{location_href}', encodeURIComponent(location.href)); $pp_pic_holder.find('.pp_social').html(facebook_like_link); } if($ppt.is(':hidden')) $ppt.css('opacity',0).show(); $pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity); $pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).size()); if(typeof pp_descriptions[set_position]!='undefined'&&pp_descriptions[set_position]!=""){ $pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position])); }else{ $pp_pic_holder.find('.pp_description').hide(); } movie_width=(parseFloat(getParam('width',pp_images[set_position]))) ? getParam('width',pp_images[set_position]):settings.default_width.toString(); movie_height=(parseFloat(getParam('height',pp_images[set_position]))) ? getParam('height',pp_images[set_position]):settings.default_height.toString(); percentBased=false; if(movie_height.indexOf('%')!=-1){ movie_height=parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); percentBased=true; } if(movie_width.indexOf('%')!=-1){ movie_width=parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased=true; } $pp_pic_holder.fadeIn(function(){ (settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined") ? $ppt.html(unescape(pp_titles[set_position])):$ppt.html(' '); imgPreloader=""; skipInjection=false; switch(_getFileType(pp_images[set_position])){ case 'image': imgPreloader=new Image(); nextImage=new Image(); if(isSet&&set_position < $(pp_images).size() -1) nextImage.src=pp_images[set_position + 1]; prevImage=new Image(); if(isSet&&pp_images[set_position - 1]) prevImage.src=pp_images[set_position - 1]; $pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]); imgPreloader.onload=function(){ pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height); _showContent(); }; imgPreloader.onerror=function(){ alert('Image cannot be loaded. Make sure the path is correct and image exist.'); $.prettyPhoto.close(); }; imgPreloader.src=pp_images[set_position]; break; case 'youtube': pp_dimensions=_fitToViewport(movie_width,movie_height); movie_id=getParam('v',pp_images[set_position]); if(movie_id==""){ movie_id=pp_images[set_position].split('youtu.be/'); movie_id=movie_id[1]; if(movie_id.indexOf('?') > 0) movie_id=movie_id.substr(0,movie_id.indexOf('?')); if(movie_id.indexOf('&') > 0) movie_id=movie_id.substr(0,movie_id.indexOf('&')); } movie='http://www.youtube.com/embed/'+movie_id; (getParam('rel',pp_images[set_position])) ? movie+="?rel="+getParam('rel',pp_images[set_position]):movie+="?rel=1"; if(settings.autoplay) movie +="&autoplay=1"; toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie); break; case 'vimeo': pp_dimensions=_fitToViewport(movie_width,movie_height); movie_id=pp_images[set_position]; var regExp=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/; var match=movie_id.match(regExp); movie='http://player.vimeo.com/video/'+ match[3] +'?title=0&byline=0&portrait=0'; if(settings.autoplay) movie +="&autoplay=1;"; vimeo_width=pp_dimensions['width'] + '/embed/?moog_width='+ pp_dimensions['width']; toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie); break; case 'quicktime': pp_dimensions=_fitToViewport(movie_width,movie_height); pp_dimensions['height']+=15; pp_dimensions['contentHeight']+=15; pp_dimensions['containerHeight']+=15; toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay); break; case 'flash': pp_dimensions=_fitToViewport(movie_width,movie_height); flash_vars=pp_images[set_position]; flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10,pp_images[set_position].length); filename=pp_images[set_position]; filename=filename.substring(0,filename.indexOf('?')); toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars); break; case 'iframe': pp_dimensions=_fitToViewport(movie_width,movie_height); frame_url=pp_images[set_position]; frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1); toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url); break; case 'ajax': doresize=false; pp_dimensions=_fitToViewport(movie_width,movie_height); doresize=true; skipInjection=true; $.get(pp_images[set_position],function(responseHTML){ toInject=settings.inline_markup.replace(/{content}/g,responseHTML); $pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject; _showContent(); }); break; case 'custom': pp_dimensions=_fitToViewport(movie_width,movie_height); toInject=settings.custom_markup; break; case 'inline': myClone=$(pp_images[set_position]).clone().append('
').css({'width':settings.default_width}).wrapInner('
').appendTo($('body')).show(); doresize=false; pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height()); doresize=true; $(myClone).remove(); toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html()); break; }; if(!imgPreloader&&!skipInjection){ $pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject; _showContent(); };}); return false; }; $.prettyPhoto.changePage=function(direction){ currentGalleryPage=0; if(direction=='previous'){ set_position--; if(set_position < 0) set_position=$(pp_images).size()-1; }else if(direction=='next'){ set_position++; if(set_position > $(pp_images).size()-1) set_position=0; }else{ set_position=direction; }; rel_index=set_position; if(!doresize) doresize=true; if(settings.allow_expand){ $('.pp_contract').removeClass('pp_contract').addClass('pp_expand'); } _hideContent(function(){ $.prettyPhoto.open(); }); }; $.prettyPhoto.changeGalleryPage=function(direction){ if(direction=='next'){ currentGalleryPage ++; if(currentGalleryPage > totalPage) currentGalleryPage=0; }else if(direction=='previous'){ currentGalleryPage --; if(currentGalleryPage < 0) currentGalleryPage=totalPage; }else{ currentGalleryPage=direction; }; slide_speed=(direction=='next'||direction=='previous') ? settings.animation_speed:0; slide_to=currentGalleryPage * (itemsPerPage * itemWidth); $pp_gallery.find('ul').animate({left:-slide_to},slide_speed); }; $.prettyPhoto.startSlideshow=function(){ if(typeof pp_slideshow=='undefined'){ $pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){ $.prettyPhoto.stopSlideshow(); return false; }); pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow); }else{ $.prettyPhoto.changePage('next'); };} $.prettyPhoto.stopSlideshow=function(){ $pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){ $.prettyPhoto.startSlideshow(); return false; }); clearInterval(pp_slideshow); pp_slideshow=undefined; } $.prettyPhoto.close=function(){ if($pp_overlay.is(":animated")) return; $.prettyPhoto.stopSlideshow(); $pp_pic_holder.stop().find('object,embed').css('visibility','hidden'); $('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){ $(this).remove(); }); $pp_overlay.fadeOut(settings.animation_speed, function(){ if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible'); $(this).remove(); $(window).unbind('scroll.prettyphoto'); clearHashtag(); settings.callback(); doresize=true; pp_open=false; delete settings; }); }; function _showContent(){ $('.pp_loaderIcon').hide(); projectedTop=scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2)); if(projectedTop < 0) projectedTop=0; $ppt.fadeTo(settings.animation_speed,1); $pp_pic_holder.find('.pp_content') .animate({ height:pp_dimensions['contentHeight'], width:pp_dimensions['contentWidth'] },settings.animation_speed); $pp_pic_holder.animate({ 'top': projectedTop, 'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0:(windowWidth/2) - (pp_dimensions['containerWidth']/2), width:pp_dimensions['containerWidth'] },settings.animation_speed,function(){ $pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']); $pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); if(isSet&&_getFileType(pp_images[set_position])=="image"){ $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); } if(settings.allow_expand){ if(pp_dimensions['resized']){ $('a.pp_expand,a.pp_contract').show(); }else{ $('a.pp_expand').hide(); }} if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open) $.prettyPhoto.startSlideshow(); settings.changepicturecallback(); pp_open=true; }); _insert_gallery(); pp_settings.ajaxcallback(); }; function _hideContent(callback){ $pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden'); $pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){ $('.pp_loaderIcon').show(); callback(); }); }; function _checkPosition(setCount){ (setCount > 1) ? $('.pp_nav').show():$('.pp_nav').hide(); }; function _fitToViewport(width,height){ resized=false; _getDimensions(width,height); imageWidth=width, imageHeight=height; if(((pp_containerWidth > windowWidth)||(pp_containerHeight > windowHeight))&&doresize&&settings.allow_resize&&!percentBased){ resized=true, fitting=false; while (!fitting){ if((pp_containerWidth > windowWidth)){ imageWidth=(windowWidth - 200); imageHeight=(height/width) * imageWidth; }else if((pp_containerHeight > windowHeight)){ imageHeight=(windowHeight - 200); imageWidth=(width/height) * imageHeight; }else{ fitting=true; }; pp_containerHeight=imageHeight, pp_containerWidth=imageWidth; }; if((pp_containerWidth > windowWidth)||(pp_containerHeight > windowHeight)){ _fitToViewport(pp_containerWidth,pp_containerHeight) }; _getDimensions(imageWidth,imageHeight); }; return { width:Math.floor(imageWidth), height:Math.floor(imageHeight), containerHeight:Math.floor(pp_containerHeight), containerWidth:Math.floor(pp_containerWidth) + (settings.horizontal_padding * 2), contentHeight:Math.floor(pp_contentHeight), contentWidth:Math.floor(pp_contentWidth), resized:resized };}; function _getDimensions(width,height){ width=parseFloat(width); height=parseFloat(height); $pp_details=$pp_pic_holder.find('.pp_details'); $pp_details.width(width); detailsHeight=parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom')); $pp_details=$pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({ 'position':'absolute', 'top':-10000 }); detailsHeight +=$pp_details.height(); detailsHeight=(detailsHeight <=34) ? 36:detailsHeight; $pp_details.remove(); $pp_title=$pp_pic_holder.find('.ppt'); $pp_title.width(width); titleHeight=parseFloat($pp_title.css('marginTop')) + parseFloat($pp_title.css('marginBottom')); $pp_title=$pp_title.clone().appendTo($('body')).css({ 'position':'absolute', 'top':-10000 }); titleHeight +=$pp_title.height(); $pp_title.remove(); pp_contentHeight=height + detailsHeight; pp_contentWidth=width; pp_containerHeight=pp_contentHeight + titleHeight + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height(); pp_containerWidth=width; } function _getFileType(itemSrc){ if(itemSrc.match(/youtube\.com\/watch/i)||itemSrc.match(/youtu\.be/i)){ return 'youtube'; }else if(itemSrc.match(/vimeo\.com/i)){ return 'vimeo'; }else if(itemSrc.match(/\b.mov\b/i)){ return 'quicktime'; }else if(itemSrc.match(/\b.swf\b/i)){ return 'flash'; }else if(itemSrc.match(/\biframe=true\b/i)){ return 'iframe'; }else if(itemSrc.match(/\bajax=true\b/i)){ return 'ajax'; }else if(itemSrc.match(/\bcustom=true\b/i)){ return 'custom'; }else if(itemSrc.substr(0,1)=='#'){ return 'inline'; }else{ return 'image'; };}; function _center_overlay(){ if(doresize&&typeof $pp_pic_holder!='undefined'){ scroll_pos=_get_scroll(); contentHeight=$pp_pic_holder.height(), contentwidth=$pp_pic_holder.width(); projectedTop=(windowHeight/2) + scroll_pos['scrollTop'] - (contentHeight/2); if(projectedTop < 0) projectedTop=0; if(contentHeight > windowHeight) return; $pp_pic_holder.css({ 'top': projectedTop, 'left': (windowWidth/2) + scroll_pos['scrollLeft'] - (contentwidth/2) }); };}; function _get_scroll(){ if(self.pageYOffset){ return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){ return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){ return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};}; }; function _resize_overlay(){ windowHeight=$(window).height(), windowWidth=$(window).width(); if(typeof $pp_overlay!="undefined") $pp_overlay.height($(document).height()).width(windowWidth); }; function _insert_gallery(){ if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"){ itemWidth=52+5; navWidth=(settings.theme=="facebook"||settings.theme=="pp_default") ? 50:30; itemsPerPage=Math.floor((pp_dimensions['containerWidth'] - 100 - navWidth) / itemWidth); itemsPerPage=(itemsPerPage < pp_images.length) ? itemsPerPage:pp_images.length; totalPage=Math.ceil(pp_images.length / itemsPerPage) - 1; if(totalPage==0){ navWidth=0; $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide(); }else{ $pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show(); }; galleryWidth=itemsPerPage * itemWidth; fullGalleryWidth=pp_images.length * itemWidth; $pp_gallery .css('margin-left',-((galleryWidth/2) + (navWidth/2))) .find('div:first').width(galleryWidth+5) .find('ul').width(fullGalleryWidth) .find('li.selected').removeClass('selected'); goToPage=(Math.floor(set_position/itemsPerPage) < totalPage) ? Math.floor(set_position/itemsPerPage):totalPage; $.prettyPhoto.changeGalleryPage(goToPage); $pp_gallery_li.filter(':eq('+set_position+')').addClass('selected'); }else{ $pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave'); }} function _build_overlay(caller){ if(settings.social_tools) facebook_like_link=settings.social_tools.replace('{location_href}', encodeURIComponent(location.href)); settings.markup=settings.markup.replace('{pp_social}',''); $('body').append(settings.markup); $pp_pic_holder=$('.pp_pic_holder') , $ppt=$('.ppt'), $pp_overlay=$('div.pp_overlay'); if(isSet&&settings.overlay_gallery){ currentGalleryPage=0; toInject=""; for (var i=0; i < pp_images.length; i++){ if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){ classname='default'; img_src=''; }else{ classname=''; img_src=pp_images[i]; } toInject +="
  • "; }; toInject=settings.gallery_markup.replace(/{gallery}/g,toInject); $pp_pic_holder.find('#pp_full_res').after(toInject); $pp_gallery=$('.pp_pic_holder .pp_gallery'), $pp_gallery_li=$pp_gallery.find('li'); $pp_gallery.find('.pp_arrow_next').click(function(){ $.prettyPhoto.changeGalleryPage('next'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_gallery.find('.pp_arrow_previous').click(function(){ $.prettyPhoto.changeGalleryPage('previous'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_content').hover(function(){ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn(); }, function(){ $pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut(); }); itemWidth=52+5; $pp_gallery_li.each(function(i){ $(this) .find('a') .click(function(){ $.prettyPhoto.changePage(i); $.prettyPhoto.stopSlideshow(); return false; }); }); }; if(settings.slideshow){ $pp_pic_holder.find('.pp_nav').prepend('Play') $pp_pic_holder.find('.pp_nav .pp_play').click(function(){ $.prettyPhoto.startSlideshow(); return false; }); } $pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); $pp_overlay .css({ 'opacity':0, 'height':$(document).height(), 'width':$(window).width() }) .bind('click',function(){ if(!settings.modal) $.prettyPhoto.close(); }); $('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; }); if(settings.allow_expand){ $('a.pp_expand').bind('click',function(e){ if($(this).hasClass('pp_expand')){ $(this).removeClass('pp_expand').addClass('pp_contract'); doresize=false; }else{ $(this).removeClass('pp_contract').addClass('pp_expand'); doresize=true; }; _hideContent(function(){ $.prettyPhoto.open(); }); return false; }); } $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){ $.prettyPhoto.changePage('previous'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){ $.prettyPhoto.changePage('next'); $.prettyPhoto.stopSlideshow(); return false; }); _center_overlay(); }; if(!pp_alreadyInitialized&&getHashtag()){ pp_alreadyInitialized=true; hashIndex=getHashtag(); hashRel=hashIndex; hashIndex=hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1); hashRel=hashRel.substring(0,hashRel.indexOf('/')); setTimeout(function(){ $("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click'); },50); } return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize); }; function getHashtag(){ var url=location.href; hashtag=(url.indexOf('#prettyPhoto')!==-1) ? decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)):false; if(hashtag){ hashtag=hashtag.replace(/<|>/g,''); } return hashtag; }; function setHashtag(){ if(typeof theRel=='undefined') return; location.hash=theRel + '/'+rel_index+'/'; }; function clearHashtag(){ if(location.href.indexOf('#prettyPhoto')!==-1) location.hash="prettyPhoto"; } function getParam(name,url){ name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS="[\\?&]"+name+"=([^&#]*)"; var regex=new RegExp(regexS); var results=regex.exec(url); return(results==null) ? "":results[1]; }})(jQuery); var pp_alreadyInitialized=false; ;(function($, window, document, undefined){ function Owl(element, options){ this.settings=null; this.options=$.extend({}, Owl.Defaults, options); this.$element=$(element); this._handlers={}; this._plugins={}; this._supress={}; this._current=null; this._speed=null; this._coordinates=[]; this._breakpoint=null; this._width=null; this._items=[]; this._clones=[]; this._mergers=[]; this._widths=[]; this._invalidated={}; this._pipe=[]; this._drag={ time: null, target: null, pointer: null, stage: { start: null, current: null }, direction: null }; this._states={ current: {}, tags: { 'initializing': [ 'busy' ], 'animating': [ 'busy' ], 'dragging': [ 'interacting' ] }}; $.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler){ this._handlers[handler]=$.proxy(this[handler], this); }, this)); $.each(Owl.Plugins, $.proxy(function(key, plugin){ this._plugins[key[0].toLowerCase() + key.slice(1)] = new plugin(this); }, this)); $.each(Owl.Workers, $.proxy(function(priority, worker){ this._pipe.push({ 'filter': worker.filter, 'run': $.proxy(worker.run, this) }); }, this)); this.setup(); this.initialize(); } Owl.Defaults={ items: 3, loop: false, center: false, rewind: false, mouseDrag: true, touchDrag: true, pullDrag: true, freeDrag: false, margin: 0, stagePadding: 0, merge: false, mergeFit: true, autoWidth: false, startPosition: 0, rtl: false, smartSpeed: 250, fluidSpeed: false, dragEndSpeed: false, responsive: {}, responsiveRefreshRate: 200, responsiveBaseElement: window, fallbackEasing: 'swing', info: false, nestedItemSelector: false, itemElement: 'div', stageElement: 'div', refreshClass: 'owl-refresh', loadedClass: 'owl-loaded', loadingClass: 'owl-loading', rtlClass: 'owl-rtl', responsiveClass: 'owl-responsive', dragClass: 'owl-drag', itemClass: 'owl-item', stageClass: 'owl-stage', stageOuterClass: 'owl-stage-outer', grabClass: 'owl-grab' }; Owl.Width={ Default: 'default', Inner: 'inner', Outer: 'outer' }; Owl.Type={ Event: 'event', State: 'state' }; Owl.Plugins={}; Owl.Workers=[ { filter: [ 'width', 'settings' ], run: function(){ this._width=this.$element.width(); }}, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ cache.current=this._items&&this._items[this.relative(this._current)]; }}, { filter: [ 'items', 'settings' ], run: function(){ this.$stage.children('.cloned').remove(); }}, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ var margin=this.settings.margin||'', grid = !this.settings.autoWidth, rtl=this.settings.rtl, css={ 'width': 'auto', 'margin-left': rtl ? margin:'', 'margin-right': rtl ? '':margin }; !grid&&this.$stage.children().css(css); cache.css=css; }}, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ var width=(this.width() / this.settings.items).toFixed(3) - this.settings.margin, merge=null, iterator=this._items.length, grid = !this.settings.autoWidth, widths=[]; cache.items={ merge: false, width: width }; while (iterator--){ merge=this._mergers[iterator]; merge=this.settings.mergeFit&&Math.min(merge, this.settings.items)||merge; cache.items.merge=merge > 1||cache.items.merge; widths[iterator] = !grid ? this._items[iterator].width():width * merge; } this._widths=widths; }}, { filter: [ 'items', 'settings' ], run: function(){ var clones=[], items=this._items, settings=this.settings, view=Math.max(settings.items * 2, 4), size=Math.ceil(items.length / 2) * 2, repeat=settings.loop&&items.length ? settings.rewind ? view:Math.max(view, size):0, append='', prepend=''; repeat /=2; while (repeat--){ clones.push(this.normalize(clones.length / 2, true)); append=append + items[clones[clones.length - 1]][0].outerHTML; clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true)); prepend=items[clones[clones.length - 1]][0].outerHTML + prepend; } this._clones=clones; $(append).addClass('cloned').appendTo(this.$stage); $(prepend).addClass('cloned').prependTo(this.$stage); }}, { filter: [ 'width', 'items', 'settings' ], run: function(){ var rtl=this.settings.rtl ? 1:-1, size=this._clones.length + this._items.length, iterator=-1, previous=0, current=0, coordinates=[]; while (++iterator < size){ previous=coordinates[iterator - 1]||0; current=this._widths[this.relative(iterator)] + this.settings.margin; coordinates.push(previous + current * rtl); } this._coordinates=coordinates; }}, { filter: [ 'width', 'items', 'settings' ], run: function(){ var padding=this.settings.stagePadding, coordinates=this._coordinates, css={ 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2, 'padding-left': padding||'', 'padding-right': padding||'' }; this.$stage.css(css); }}, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ var iterator=this._coordinates.length, grid = !this.settings.autoWidth, items=this.$stage.children(); if(grid&&cache.items.merge){ while (iterator--){ cache.css.width=this._widths[this.relative(iterator)]; items.eq(iterator).css(cache.css); }}else if(grid){ cache.css.width=cache.items.width; items.css(cache.css); }} }, { filter: [ 'items' ], run: function(){ this._coordinates.length < 1&&this.$stage.removeAttr('style'); }}, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ cache.current=cache.current ? this.$stage.children().index(cache.current):0; cache.current=Math.max(this.minimum(), Math.min(this.maximum(), cache.current)); this.reset(cache.current); }}, { filter: [ 'position' ], run: function(){ this.animate(this.coordinates(this._current)); }}, { filter: [ 'width', 'position', 'items', 'settings' ], run: function(){ var rtl=this.settings.rtl ? 1:-1, padding=this.settings.stagePadding * 2, begin=this.coordinates(this.current()) + padding, end=begin + this.width() * rtl, inner, outer, matches=[], i, n; for (i=0, n=this._coordinates.length; i < n; i++){ inner=this._coordinates[i - 1]||0; outer=Math.abs(this._coordinates[i]) + padding * rtl; if((this.op(inner, '<=', begin)&&(this.op(inner, '>', end))) || (this.op(outer, '<', begin)&&this.op(outer, '>', end))){ matches.push(i); }} this.$stage.children('.active').removeClass('active'); this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active'); if(this.settings.center){ this.$stage.children('.center').removeClass('center'); this.$stage.children().eq(this.current()).addClass('center'); }} } ]; Owl.prototype.initialize=function(){ this.enter('initializing'); this.trigger('initialize'); this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl); if(this.settings.autoWidth&&!this.is('pre-loading')){ var imgs, nestedSelector, width; imgs=this.$element.find('img'); nestedSelector=this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector:undefined; width=this.$element.children(nestedSelector).width(); if(imgs.length&&width <=0){ this.preloadAutoWidthImages(imgs); }} this.$element.addClass(this.options.loadingClass); this.$stage=$('<' + this.settings.stageElement + ' class="' + this.settings.stageClass + '"/>') .wrap('
    '); this.$element.append(this.$stage.parent()); this.replace(this.$element.children().not(this.$stage.parent())); if(this.$element.is(':visible')){ this.refresh(); }else{ this.invalidate('width'); } this.$element .removeClass(this.options.loadingClass) .addClass(this.options.loadedClass); this.registerEventHandlers(); this.leave('initializing'); this.trigger('initialized'); }; Owl.prototype.setup=function(){ var viewport=this.viewport(), overwrites=this.options.responsive, match=-1, settings=null; if(!overwrites){ settings=$.extend({}, this.options); }else{ $.each(overwrites, function(breakpoint){ if(breakpoint <=viewport&&breakpoint > match){ match=Number(breakpoint); }}); settings=$.extend({}, this.options, overwrites[match]); delete settings.responsive; if(settings.responsiveClass){ this.$element.attr('class', this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match) ); }} if(this.settings===null||this._breakpoint!==match){ this.trigger('change', { property: { name: 'settings', value: settings }}); this._breakpoint=match; this.settings=settings; this.invalidate('settings'); this.trigger('changed', { property: { name: 'settings', value: this.settings }}); }}; Owl.prototype.optionsLogic=function(){ if(this.settings.autoWidth){ this.settings.stagePadding=false; this.settings.merge=false; }}; Owl.prototype.prepare=function(item){ var event=this.trigger('prepare', { content: item }); if(!event.data){ event.data=$('<' + this.settings.itemElement + '/>') .addClass(this.options.itemClass).append(item) } this.trigger('prepared', { content: event.data }); return event.data; }; Owl.prototype.update=function(){ var i=0, n=this._pipe.length, filter=$.proxy(function(p){ return this[p] }, this._invalidated), cache={}; while (i < n){ if(this._invalidated.all||$.grep(this._pipe[i].filter, filter).length > 0){ this._pipe[i].run(cache); } i++; } this._invalidated={}; !this.is('valid')&&this.enter('valid'); }; Owl.prototype.width=function(dimension){ dimension=dimension||Owl.Width.Default; switch (dimension){ case Owl.Width.Inner: case Owl.Width.Outer: return this._width; default: return this._width - this.settings.stagePadding * 2 + this.settings.margin; }}; Owl.prototype.refresh=function(){ this.enter('refreshing'); this.trigger('refresh'); this.setup(); this.optionsLogic(); this.$element.addClass(this.options.refreshClass); this.update(); this.$element.removeClass(this.options.refreshClass); this.leave('refreshing'); this.trigger('refreshed'); }; Owl.prototype.onThrottledResize=function(){ window.clearTimeout(this.resizeTimer); this.resizeTimer=window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate); }; Owl.prototype.onResize=function(){ if(!this._items.length){ return false; } if(this._width===this.$element.width()){ return false; } if(!this.$element.is(':visible')){ return false; } this.enter('resizing'); if(this.trigger('resize').isDefaultPrevented()){ this.leave('resizing'); return false; } this.invalidate('width'); this.refresh(); this.leave('resizing'); this.trigger('resized'); }; Owl.prototype.registerEventHandlers=function(){ if($.support.transition){ this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this)); } if(this.settings.responsive!==false){ this.on(window, 'resize', this._handlers.onThrottledResize); } if(this.settings.mouseDrag){ this.$element.addClass(this.options.dragClass); this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this)); this.$stage.on('dragstart.owl.core selectstart.owl.core', function(){ return false }); } if(this.settings.touchDrag){ this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this)); this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this)); }}; Owl.prototype.onDragStart=function(event){ var stage=null; if(event.which===3){ return; } if($.support.transform){ stage=this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(','); stage={ x: stage[stage.length===16 ? 12:4], y: stage[stage.length===16 ? 13:5] };}else{ stage=this.$stage.position(); stage={ x: this.settings.rtl ? stage.left + this.$stage.width() - this.width() + this.settings.margin : stage.left, y: stage.top };} if(this.is('animating')){ $.support.transform ? this.animate(stage.x):this.$stage.stop() this.invalidate('position'); } this.$element.toggleClass(this.options.grabClass, event.type==='mousedown'); this.speed(0); this._drag.time=new Date().getTime(); this._drag.target=$(event.target); this._drag.stage.start=stage; this._drag.stage.current=stage; this._drag.pointer=this.pointer(event); $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this)); $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event){ var delta=this.difference(this._drag.pointer, this.pointer(event)); $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this)); if(Math.abs(delta.x) < Math.abs(delta.y)&&this.is('valid')){ return; } event.preventDefault(); this.enter('dragging'); this.trigger('drag'); }, this)); }; Owl.prototype.onDragMove=function(event){ var minimum=null, maximum=null, pull=null, delta=this.difference(this._drag.pointer, this.pointer(event)), stage=this.difference(this._drag.stage.start, delta); if(!this.is('dragging')){ return; } event.preventDefault(); if(this.settings.loop){ minimum=this.coordinates(this.minimum()); maximum=this.coordinates(this.maximum() + 1) - minimum; stage.x=(((stage.x - minimum) % maximum + maximum) % maximum) + minimum; }else{ minimum=this.settings.rtl ? this.coordinates(this.maximum()):this.coordinates(this.minimum()); maximum=this.settings.rtl ? this.coordinates(this.minimum()):this.coordinates(this.maximum()); pull=this.settings.pullDrag ? -1 * delta.x / 5:0; stage.x=Math.max(Math.min(stage.x, minimum + pull), maximum + pull); } this._drag.stage.current=stage; this.animate(stage.x); }; Owl.prototype.onDragEnd=function(event){ var delta=this.difference(this._drag.pointer, this.pointer(event)), stage=this._drag.stage.current, direction=delta.x > 0 ^ this.settings.rtl ? 'left':'right'; $(document).off('.owl.core'); this.$element.removeClass(this.options.grabClass); if(delta.x!==0&&this.is('dragging')||!this.is('valid')){ this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed); this.current(this.closest(stage.x, delta.x!==0 ? direction:this._drag.direction)); this.invalidate('position'); this.update(); this._drag.direction=direction; if(Math.abs(delta.x) > 3||new Date().getTime() - this._drag.time > 300){ this._drag.target.one('click.owl.core', function(){ return false; }); }} if(!this.is('dragging')){ return; } this.leave('dragging'); this.trigger('dragged'); }; Owl.prototype.closest=function(coordinate, direction){ var position=-1, pull=30, width=this.width(), coordinates=this.coordinates(); if(!this.settings.freeDrag){ $.each(coordinates, $.proxy(function(index, value){ if(coordinate > value - pull&&coordinate < value + pull){ position=index; }else if(this.op(coordinate, '<', value) && this.op(coordinate, '>', coordinates[index + 1]||value - width)){ position=direction==='left' ? index + 1:index; } return position===-1; }, this)); } if(!this.settings.loop){ if(this.op(coordinate, '>', coordinates[this.minimum()])){ position=coordinate=this.minimum(); }else if(this.op(coordinate, '<', coordinates[this.maximum()])){ position=coordinate=this.maximum(); }} return position; }; Owl.prototype.animate=function(coordinate){ var animate=this.speed() > 0; this.is('animating')&&this.onTransitionEnd(); if(animate){ this.enter('animating'); this.trigger('translate'); } if($.support.transform3d&&$.support.transition){ this.$stage.css({ transform: 'translate3d(' + coordinate + 'px,0px,0px)', transition: (this.speed() / 1000) + 's' }); }else if(animate){ this.$stage.animate({ left: coordinate + 'px' }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this)); }else{ this.$stage.css({ left: coordinate + 'px' }); }}; Owl.prototype.is=function(state){ return this._states.current[state]&&this._states.current[state] > 0; }; Owl.prototype.current=function(position){ if(position===undefined){ return this._current; } if(this._items.length===0){ return undefined; } position=this.normalize(position); if(this._current!==position){ var event=this.trigger('change', { property: { name: 'position', value: position }}); if(event.data!==undefined){ position=this.normalize(event.data); } this._current=position; this.invalidate('position'); this.trigger('changed', { property: { name: 'position', value: this._current }}); } return this._current; }; Owl.prototype.invalidate=function(part){ if($.type(part)==='string'){ this._invalidated[part]=true; this.is('valid')&&this.leave('valid'); } return $.map(this._invalidated, function(v, i){ return i }); }; Owl.prototype.reset=function(position){ position=this.normalize(position); if(position===undefined){ return; } this._speed=0; this._current=position; this.suppress([ 'translate', 'translated' ]); this.animate(this.coordinates(position)); this.release([ 'translate', 'translated' ]); }; Owl.prototype.normalize=function(position, relative){ var n=this._items.length, m=relative ? 0:this._clones.length; if(!$.isNumeric(position)||n < 1){ position=undefined; }else if(position < 0||position >=n + m){ position=((position - m / 2) % n + n) % n + m / 2; } return position; }; Owl.prototype.relative=function(position){ position -=this._clones.length / 2; return this.normalize(position, true); }; Owl.prototype.maximum=function(relative){ var settings=this.settings, maximum=this._coordinates.length, boundary=Math.abs(this._coordinates[maximum - 1]) - this._width, i=-1, j; if(settings.loop){ maximum=this._clones.length / 2 + this._items.length - 1; }else if(settings.autoWidth||settings.merge){ while (maximum - i > 1){ Math.abs(this._coordinates[j=maximum + i >> 1]) < boundary ? i=j:maximum=j; }}else if(settings.center){ maximum=this._items.length - 1; }else{ maximum=this._items.length - settings.items; } if(relative){ maximum -=this._clones.length / 2; } return Math.max(maximum, 0); }; Owl.prototype.minimum=function(relative){ return relative ? 0:this._clones.length / 2; }; Owl.prototype.items=function(position){ if(position===undefined){ return this._items.slice(); } position=this.normalize(position, true); return this._items[position]; }; Owl.prototype.mergers=function(position){ if(position===undefined){ return this._mergers.slice(); } position=this.normalize(position, true); return this._mergers[position]; }; Owl.prototype.clones=function(position){ var odd=this._clones.length / 2, even=odd + this._items.length, map=function(index){ return index % 2===0 ? even + index / 2:odd - (index + 1) / 2 }; if(position===undefined){ return $.map(this._clones, function(v, i){ return map(i) }); } return $.map(this._clones, function(v, i){ return v===position ? map(i):null }); }; Owl.prototype.speed=function(speed){ if(speed!==undefined){ this._speed=speed; } return this._speed; }; Owl.prototype.coordinates=function(position){ var coordinate=null; if(position===undefined){ return $.map(this._coordinates, $.proxy(function(coordinate, index){ return this.coordinates(index); }, this)); } if(this.settings.center){ coordinate=this._coordinates[position]; coordinate +=(this.width() - coordinate + (this._coordinates[position - 1]||0)) / 2 * (this.settings.rtl ? -1:1); }else{ coordinate=this._coordinates[position - 1]||0; } return coordinate; }; Owl.prototype.duration=function(from, to, factor){ return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor||this.settings.smartSpeed)); }; Owl.prototype.to=function(position, speed){ var current=this.current(), revert=null, distance=position - this.relative(current), direction=(distance > 0) - (distance < 0), items=this._items.length, minimum=this.minimum(), maximum=this.maximum(); if(this.settings.loop){ if(!this.settings.rewind&&Math.abs(distance) > items / 2){ distance +=direction * -1 * items; } position=current + distance; revert=((position - minimum) % items + items) % items + minimum; if(revert!==position&&revert - distance <=maximum&&revert - distance > 0){ current=revert - distance; position=revert; this.reset(current); }}else if(this.settings.rewind){ maximum +=1; position=(position % maximum + maximum) % maximum; }else{ position=Math.max(minimum, Math.min(maximum, position)); } this.speed(this.duration(current, position, speed)); this.current(position); if(this.$element.is(':visible')){ this.update(); }}; Owl.prototype.next=function(speed){ speed=speed||false; this.to(this.relative(this.current()) + 1, speed); }; Owl.prototype.prev=function(speed){ speed=speed||false; this.to(this.relative(this.current()) - 1, speed); }; Owl.prototype.onTransitionEnd=function(event){ if(event!==undefined){ event.stopPropagation(); if((event.target||event.srcElement||event.originalTarget)!==this.$stage.get(0)){ return false; }} this.leave('animating'); this.trigger('translated'); }; Owl.prototype.viewport=function(){ var width; if(this.options.responsiveBaseElement!==window){ width=$(this.options.responsiveBaseElement).width(); }else if(window.innerWidth){ width=window.innerWidth; }else if(document.documentElement&&document.documentElement.clientWidth){ width=document.documentElement.clientWidth; }else{ throw 'Can not detect viewport width.'; } return width; }; Owl.prototype.replace=function(content){ this.$stage.empty(); this._items=[]; if(content){ content=(content instanceof jQuery) ? content:$(content); } if(this.settings.nestedItemSelector){ content=content.find('.' + this.settings.nestedItemSelector); } content.filter(function(){ return this.nodeType===1; }).each($.proxy(function(index, item){ item=this.prepare(item); this.$stage.append(item); this._items.push(item); this._mergers.push(item.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1); }, this)); this.reset($.isNumeric(this.settings.startPosition) ? this.settings.startPosition:0); this.invalidate('items'); }; Owl.prototype.add=function(content, position){ var current=this.relative(this._current); position=position===undefined ? this._items.length:this.normalize(position, true); content=content instanceof jQuery ? content:$(content); this.trigger('add', { content: content, position: position }); content=this.prepare(content); if(this._items.length===0||position===this._items.length){ this._items.length===0&&this.$stage.append(content); this._items.length!==0&&this._items[position - 1].after(content); this._items.push(content); this._mergers.push(content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1); }else{ this._items[position].before(content); this._items.splice(position, 0, content); this._mergers.splice(position, 0, content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1); } this._items[current]&&this.reset(this._items[current].index()); this.invalidate('items'); this.trigger('added', { content: content, position: position }); }; Owl.prototype.remove=function(position){ position=this.normalize(position, true); if(position===undefined){ return; } this.trigger('remove', { content: this._items[position], position: position }); this._items[position].remove(); this._items.splice(position, 1); this._mergers.splice(position, 1); this.invalidate('items'); this.trigger('removed', { content: null, position: position }); }; Owl.prototype.preloadAutoWidthImages=function(images){ images.each($.proxy(function(i, element){ this.enter('pre-loading'); element=$(element); $(new Image()).one('load', $.proxy(function(e){ element.attr('src', e.target.src); element.css('opacity', 1); this.leave('pre-loading'); !this.is('pre-loading')&&!this.is('initializing')&&this.refresh(); }, this)).attr('src', element.attr('src')||element.attr('data-src')||element.attr('data-src-retina')); }, this)); }; Owl.prototype.destroy=function(){ this.$element.off('.owl.core'); this.$stage.off('.owl.core'); $(document).off('.owl.core'); if(this.settings.responsive!==false){ window.clearTimeout(this.resizeTimer); this.off(window, 'resize', this._handlers.onThrottledResize); } for (var i in this._plugins){ this._plugins[i].destroy(); } this.$stage.children('.cloned').remove(); this.$stage.unwrap(); this.$stage.children().contents().unwrap(); this.$stage.children().unwrap(); this.$element .removeClass(this.options.refreshClass) .removeClass(this.options.loadingClass) .removeClass(this.options.loadedClass) .removeClass(this.options.rtlClass) .removeClass(this.options.dragClass) .removeClass(this.options.grabClass) .attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), '')) .removeData('owl.vccarousel'); }; Owl.prototype.op=function(a, o, b){ var rtl=this.settings.rtl; switch (o){ case '<': return rtl ? a > b:a < b; case '>': return rtl ? a < b:a > b; case '>=': return rtl ? a <=b:a >=b; case '<=': return rtl ? a >=b:a <=b; default: break; }}; Owl.prototype.on=function(element, event, listener, capture){ if(element.addEventListener){ element.addEventListener(event, listener, capture); }else if(element.attachEvent){ element.attachEvent('on' + event, listener); }}; Owl.prototype.off=function(element, event, listener, capture){ if(element.removeEventListener){ element.removeEventListener(event, listener, capture); }else if(element.detachEvent){ element.detachEvent('on' + event, listener); }}; Owl.prototype.trigger=function(name, data, namespace, state, enter){ var status={ item: { count: this._items.length, index: this.current() }}, handler=$.camelCase($.grep([ 'on', name, namespace ], function(v){ return v }) .join('-').toLowerCase() ), event=$.Event([ name, 'owl', namespace||'vccarousel' ].join('.').toLowerCase(), $.extend({ relatedTarget: this }, status, data) ); if(!this._supress[name]){ $.each(this._plugins, function(name, plugin){ if(plugin.onTrigger){ plugin.onTrigger(event); }}); this.register({ type: Owl.Type.Event, name: name }); this.$element.trigger(event); if(this.settings&&typeof this.settings[handler]==='function'){ this.settings[handler].call(this, event); }} return event; }; Owl.prototype.enter=function(name){ $.each([ name ].concat(this._states.tags[name]||[]), $.proxy(function(i, name){ if(this._states.current[name]===undefined){ this._states.current[name]=0; } this._states.current[name]++; }, this)); }; Owl.prototype.leave=function(name){ $.each([ name ].concat(this._states.tags[name]||[]), $.proxy(function(i, name){ this._states.current[name]--; }, this)); }; Owl.prototype.register=function(object){ if(object.type===Owl.Type.Event){ if(!$.event.special[object.name]){ $.event.special[object.name]={};} if(!$.event.special[object.name].owl){ var _default=$.event.special[object.name]._default; $.event.special[object.name]._default=function(e){ if(_default&&_default.apply&&(!e.namespace||e.namespace.indexOf('owl')===-1)){ return _default.apply(this, arguments); } return e.namespace&&e.namespace.indexOf('owl') > -1; }; $.event.special[object.name].owl=true; }}else if(object.type===Owl.Type.State){ if(!this._states.tags[object.name]){ this._states.tags[object.name]=object.tags; }else{ this._states.tags[object.name]=this._states.tags[object.name].concat(object.tags); } this._states.tags[object.name]=$.grep(this._states.tags[object.name], $.proxy(function(tag, i){ return $.inArray(tag, this._states.tags[object.name])===i; }, this)); }}; Owl.prototype.suppress=function(events){ $.each(events, $.proxy(function(index, event){ this._supress[event]=true; }, this)); }; Owl.prototype.release=function(events){ $.each(events, $.proxy(function(index, event){ delete this._supress[event]; }, this)); }; Owl.prototype.pointer=function(event){ var result={ x: null, y: null }; event=event.originalEvent||event||window.event; event=event.touches&&event.touches.length ? event.touches[0]:event.changedTouches&&event.changedTouches.length ? event.changedTouches[0]:event; if(event.pageX){ result.x=event.pageX; result.y=event.pageY; }else{ result.x=event.clientX; result.y=event.clientY; } return result; }; Owl.prototype.difference=function(first, second){ return { x: first.x - second.x, y: first.y - second.y };}; $.fn.vcOwlCarousel=function(option){ var args=Array.prototype.slice.call(arguments, 1); return this.each(function(){ var $this=$(this), data=$this.data('owl.vccarousel'); if(!data){ data=new Owl(this, typeof option=='object'&&option); $this.data('owl.vccarousel', data); $.each([ 'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove' ], function(i, event){ data.register({ type: Owl.Type.Event, name: event }); data.$element.on(event + '.owl.vccarousel.core', $.proxy(function(e){ if(e.namespace&&e.relatedTarget!==this){ this.suppress([ event ]); data[event].apply(this, [].slice.call(arguments, 1)); this.release([ event ]); }}, data)); }); } if(typeof option=='string'&&option.charAt(0)!=='_'){ data[option].apply(data, args); }}); }; $.fn.vcOwlCarousel.Constructor=Owl; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var AutoRefresh=function(carousel){ this._core=carousel; this._interval=null; this._visible=null; this._handlers={ 'initialized.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.autoRefresh){ this.watch(); }}, this) }; this._core.options=$.extend({}, AutoRefresh.Defaults, this._core.options); this._core.$element.on(this._handlers); }; AutoRefresh.Defaults={ autoRefresh: true, autoRefreshInterval: 500 }; AutoRefresh.prototype.watch=function(){ if(this._interval){ return; } this._visible=this._core.$element.is(':visible'); this._interval=window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval); }; AutoRefresh.prototype.refresh=function(){ if(this._core.$element.is(':visible')===this._visible){ return; } this._visible = !this._visible; this._core.$element.toggleClass('owl-hidden', !this._visible); this._visible&&(this._core.invalidate('width')&&this._core.refresh()); }; AutoRefresh.prototype.destroy=function(){ var handler, property; window.clearInterval(this._interval); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.vcOwlCarousel.Constructor.Plugins.AutoRefresh=AutoRefresh; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Lazy=function(carousel){ this._core=carousel; this._loaded=[]; this._handlers={ 'initialized.owl.vccarousel change.owl.vccarousel': $.proxy(function(e){ if(!e.namespace){ return; } if(!this._core.settings||!this._core.settings.lazyLoad){ return; } if((e.property&&e.property.name=='position')||e.type=='initialized'){ var settings=this._core.settings, n=(settings.center&&Math.ceil(settings.items / 2)||settings.items), i=((settings.center&&n * -1)||0), position=((e.property&&e.property.value)||this._core.current()) + i, clones=this._core.clones().length, load=$.proxy(function(i, v){ this.load(v) }, this); while (i++ < n){ this.load(clones / 2 + this._core.relative(position)); clones&&$.each(this._core.clones(this._core.relative(position)), load); position++; }} }, this) }; this._core.options=$.extend({}, Lazy.Defaults, this._core.options); this._core.$element.on(this._handlers); } Lazy.Defaults={ lazyLoad: false } Lazy.prototype.load=function(position){ var $item=this._core.$stage.children().eq(position), $elements=$item&&$item.find('.owl-lazy'); if(!$elements||$.inArray($item.get(0), this._loaded) > -1){ return; } $elements.each($.proxy(function(index, element){ var $element=$(element), image, url=(window.devicePixelRatio > 1&&$element.attr('data-src-retina'))||$element.attr('data-src'); this._core.trigger('load', { element: $element, url: url }, 'lazy'); if($element.is('img')){ $element.one('load.owl.lazy', $.proxy(function(){ $element.css('opacity', 1); this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); }, this)).attr('src', url); }else{ image=new Image(); image.onload=$.proxy(function(){ $element.css({ 'background-image': 'url(' + url + ')', 'opacity': '1' }); this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); }, this); image.src=url; }}, this)); this._loaded.push($item.get(0)); } Lazy.prototype.destroy=function(){ var handler, property; for (handler in this.handlers){ this._core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.vcOwlCarousel.Constructor.Plugins.Lazy=Lazy; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var AutoHeight=function(carousel){ this._core=carousel; this._handlers={ 'initialized.owl.vccarousel refreshed.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.autoHeight){ this.update(); }}, this), 'changed.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.autoHeight&&e.property.name=='position'){ this.update(); }}, this), 'loaded.owl.lazy': $.proxy(function(e){ if(e.namespace&&this._core.settings.autoHeight && e.element.closest('.' + this._core.settings.itemClass).index()===this._core.current()){ this.update(); }}, this) }; this._core.options=$.extend({}, AutoHeight.Defaults, this._core.options); this._core.$element.on(this._handlers); }; AutoHeight.Defaults={ autoHeight: false, autoHeightClass: 'owl-height' }; AutoHeight.prototype.update=function(){ this._core.$stage.parent() .height(this._core.$stage.children().eq(this._core.current()).height()) .addClass(this._core.settings.autoHeightClass); }; AutoHeight.prototype.destroy=function(){ var handler, property; for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.vcOwlCarousel.Constructor.Plugins.AutoHeight=AutoHeight; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Video=function(carousel){ this._core=carousel; this._videos={}; this._playing=null; this._handlers={ 'initialized.owl.vccarousel': $.proxy(function(e){ if(e.namespace){ this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] }); }}, this), 'resize.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.video&&this.isInFullScreen()){ e.preventDefault(); }}, this), 'refreshed.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._core.is('resizing')){ this._core.$stage.find('.cloned .owl-video-frame').remove(); }}, this), 'changed.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&e.property.name==='position'&&this._playing){ this.stop(); }}, this), 'prepared.owl.vccarousel': $.proxy(function(e){ if(!e.namespace){ return; } var $element=$(e.content).find('.owl-video'); if($element.length){ $element.css('display', 'none'); this.fetch($element, $(e.content)); }}, this) }; this._core.options=$.extend({}, Video.Defaults, this._core.options); this._core.$element.on(this._handlers); this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e){ this.play(e); }, this)); }; Video.Defaults={ video: false, videoHeight: false, videoWidth: false }; Video.prototype.fetch=function(target, item){ var type=target.attr('data-vimeo-id') ? 'vimeo':'youtube', id=target.attr('data-vimeo-id')||target.attr('data-youtube-id'), width=target.attr('data-width')||this._core.settings.videoWidth, height=target.attr('data-height')||this._core.settings.videoHeight, url=target.attr('href'); if(url){ id=url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/); if(id[3].indexOf('youtu') > -1){ type='youtube'; }else if(id[3].indexOf('vimeo') > -1){ type='vimeo'; }else{ throw new Error('Video URL not supported.'); } id=id[6]; }else{ throw new Error('Missing video URL.'); } this._videos[url]={ type: type, id: id, width: width, height: height }; item.attr('data-video', url); this.thumbnail(target, this._videos[url]); }; Video.prototype.thumbnail=function(target, video){ var tnLink, icon, path, dimensions=video.width&&video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"':'', customTn=target.find('img'), srcType='src', lazyClass='', settings=this._core.settings, create=function(path){ icon='
    '; if(settings.lazyLoad){ tnLink='
    '; }else{ tnLink='
    '; } target.after(tnLink); target.after(icon); }; target.wrap('
    '); if(this._core.settings.lazyLoad){ srcType='data-src'; lazyClass='owl-lazy'; } if(customTn.length){ create(customTn.attr(srcType)); customTn.remove(); return false; } if(video.type==='youtube'){ path="http://img.youtube.com/vi/" + video.id + "/hqdefault.jpg"; create(path); }else if(video.type==='vimeo'){ $.ajax({ type: 'GET', url: 'http://vimeo.com/api/v2/video/' + video.id + '.json', jsonp: 'callback', dataType: 'jsonp', success: function(data){ path=data[0].thumbnail_large; create(path); }}); }}; Video.prototype.stop=function(){ this._core.trigger('stop', null, 'video'); this._playing.find('.owl-video-frame').remove(); this._playing.removeClass('owl-video-playing'); this._playing=null; this._core.leave('playing'); this._core.trigger('stopped', null, 'video'); }; Video.prototype.play=function(event){ var target=$(event.target), item=target.closest('.' + this._core.settings.itemClass), video=this._videos[item.attr('data-video')], width=video.width||'100%', height=video.height||this._core.$stage.height(), html; if(this._playing){ return; } this._core.enter('playing'); this._core.trigger('play', null, 'video'); item=this._core.items(this._core.relative(item.index())); this._core.reset(item.index()); if(video.type==='youtube'){ html=''; }else if(video.type==='vimeo'){ html=''; } $('
    ' + html + '
    ').insertAfter(item.find('.owl-video')); this._playing=item.addClass('owl-video-playing'); }; Video.prototype.isInFullScreen=function(){ var element=document.fullscreenElement||document.mozFullScreenElement || document.webkitFullscreenElement; return element&&$(element).parent().hasClass('owl-video-frame'); }; Video.prototype.destroy=function(){ var handler, property; this._core.$element.off('click.owl.video'); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.vcOwlCarousel.Constructor.Plugins.Video=Video; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Animate=function(scope){ this.core=scope; this.core.options=$.extend({}, Animate.Defaults, this.core.options); this.swapping=true; this.previous=undefined; this.next=undefined; this.handlers={ 'change.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&e.property.name=='position'){ this.previous=this.core.current(); this.next=e.property.value; }}, this), 'drag.owl.vccarousel dragged.owl.vccarousel translated.owl.vccarousel': $.proxy(function(e){ if(e.namespace){ this.swapping=e.type=='translated'; }}, this), 'translate.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)){ this.swap(); }}, this) }; this.core.$element.on(this.handlers); }; Animate.Defaults={ animateOut: false, animateIn: false }; Animate.prototype.swap=function(){ if(this.core.settings.items!==1){ return; } if(!$.support.animation||!$.support.transition){ return; } this.core.speed(0); var left, clear=$.proxy(this.clear, this), previous=this.core.$stage.children().eq(this.previous), next=this.core.$stage.children().eq(this.next), incoming=this.core.settings.animateIn, outgoing=this.core.settings.animateOut; if(this.core.current()===this.previous){ return; } if(outgoing){ left=this.core.coordinates(this.previous) - this.core.coordinates(this.next); previous.one($.support.animation.end, clear) .css({ 'left': left + 'px' }) .addClass('animated owl-animated-out') .addClass(outgoing); } if(incoming){ next.one($.support.animation.end, clear) .addClass('animated owl-animated-in') .addClass(incoming); }}; Animate.prototype.clear=function(e){ $(e.target).css({ 'left': '' }) .removeClass('animated owl-animated-out owl-animated-in') .removeClass(this.core.settings.animateIn) .removeClass(this.core.settings.animateOut); this.core.onTransitionEnd(); }; Animate.prototype.destroy=function(){ var handler, property; for (handler in this.handlers){ this.core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.vcOwlCarousel.Constructor.Plugins.Animate=Animate; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Autoplay=function(carousel){ this._core=carousel; this._interval=null; this._paused=false; this._handlers={ 'changed.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&e.property.name==='settings'){ if(this._core.settings.autoplay){ this.play(); }else{ this.stop(); }} }, this), 'initialized.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.autoplay){ this.play(); }}, this), 'play.owl.autoplay': $.proxy(function(e, t, s){ if(e.namespace){ this.play(t, s); }}, this), 'stop.owl.autoplay': $.proxy(function(e){ if(e.namespace){ this.stop(); }}, this), 'mouseover.owl.autoplay': $.proxy(function(){ if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){ this.pause(); }}, this), 'mouseleave.owl.autoplay': $.proxy(function(){ if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){ this.play(); }}, this) }; this._core.$element.on(this._handlers); this._core.options=$.extend({}, Autoplay.Defaults, this._core.options); }; Autoplay.Defaults={ autoplay: false, autoplayTimeout: 5000, autoplayHoverPause: false, autoplaySpeed: false }; Autoplay.prototype.play=function(timeout, speed){ this._paused=false; if(this._core.is('rotating')){ return; } this._core.enter('rotating'); this._interval=window.setInterval($.proxy(function(){ if(this._paused||this._core.is('busy')||this._core.is('interacting')||document.hidden){ return; } this._core.next(speed||this._core.settings.autoplaySpeed); }, this), timeout||this._core.settings.autoplayTimeout); }; Autoplay.prototype.stop=function(){ if(!this._core.is('rotating')){ return; } window.clearInterval(this._interval); this._core.leave('rotating'); }; Autoplay.prototype.pause=function(){ if(!this._core.is('rotating')){ return; } this._paused=true; }; Autoplay.prototype.destroy=function(){ var handler, property; this.stop(); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.vcOwlCarousel.Constructor.Plugins.autoplay=Autoplay; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ 'use strict'; var Navigation=function(carousel){ this._core=carousel; this._initialized=false; this._pages=[]; this._controls={}; this._templates=[]; this.$element=this._core.$element; this._overrides={ next: this._core.next, prev: this._core.prev, to: this._core.to }; this._handlers={ 'prepared.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.dotsData){ this._templates.push('
    ' + $(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot') + '
    '); }}, this), 'added.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.dotsData){ this._templates.splice(e.position, 0, this._templates.pop()); }}, this), 'remove.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.dotsData){ this._templates.splice(e.position, 1); }}, this), 'changed.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&e.property.name=='position'){ this.draw(); }}, this), 'initialized.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&!this._initialized){ this._core.trigger('initialize', null, 'navigation'); this.initialize(); this.update(); this.draw(); this._initialized=true; this._core.trigger('initialized', null, 'navigation'); }}, this), 'refreshed.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._initialized){ this._core.trigger('refresh', null, 'navigation'); this.update(); this.draw(); this._core.trigger('refreshed', null, 'navigation'); }}, this) }; this._core.options=$.extend({}, Navigation.Defaults, this._core.options); this.$element.on(this._handlers); }; Navigation.Defaults={ nav: false, navText: [ 'prev', 'next' ], navSpeed: false, navElement: 'div', navContainer: false, navContainerClass: 'owl-nav', navClass: [ 'owl-prev', 'owl-next' ], slideBy: 1, dotClass: 'owl-dot', dotsClass: 'owl-dots', dots: true, dotsEach: false, dotsData: false, dotsSpeed: false, dotsContainer: false }; Navigation.prototype.initialize=function(){ var override, settings=this._core.settings; this._controls.$relative=(settings.navContainer ? $(settings.navContainer) : $('
    ').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled'); this._controls.$previous=$('<' + settings.navElement + '>') .addClass(settings.navClass[0]) .html(settings.navText[0]) .prependTo(this._controls.$relative) .on('click', $.proxy(function(e){ this.prev(settings.navSpeed); }, this)); this._controls.$next=$('<' + settings.navElement + '>') .addClass(settings.navClass[1]) .html(settings.navText[1]) .appendTo(this._controls.$relative) .on('click', $.proxy(function(e){ this.next(settings.navSpeed); }, this)); if(!settings.dotsData){ this._templates=[ $('
    ') .addClass(settings.dotClass) .append($('')) .prop('outerHTML') ]; } this._controls.$absolute=(settings.dotsContainer ? $(settings.dotsContainer) : $('
    ').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled'); this._controls.$absolute.on('click', 'div', $.proxy(function(e){ var index=$(e.target).parent().is(this._controls.$absolute) ? $(e.target).index():$(e.target).parent().index(); e.preventDefault(); this.to(index, settings.dotsSpeed); }, this)); for (override in this._overrides){ this._core[override]=$.proxy(this[override], this); }}; Navigation.prototype.destroy=function(){ var handler, control, property, override; for (handler in this._handlers){ this.$element.off(handler, this._handlers[handler]); } for (control in this._controls){ this._controls[control].remove(); } for (override in this.overides){ this._core[override]=this._overrides[override]; } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; Navigation.prototype.update=function(){ var i, j, k, lower=this._core.clones().length / 2, upper=lower + this._core.items().length, maximum=this._core.maximum(true), settings=this._core.settings, size=settings.center||settings.autoWidth||settings.dotsData ? 1:settings.dotsEach||settings.items; if(settings.slideBy!=='page'){ settings.slideBy=Math.min(settings.slideBy, settings.items); } if(settings.dots||settings.slideBy=='page'){ this._pages=[]; for (i=lower, j=0, k=0; i < upper; i++){ if(j >=size||j===0){ this._pages.push({ start: Math.min(maximum, i - lower), end: i - lower + size - 1 }); if(Math.min(maximum, i - lower)===maximum){ break; } j=0, ++k; } j +=this._core.mergers(this._core.relative(i)); }} }; Navigation.prototype.draw=function(){ var difference, settings=this._core.settings, disabled=this._core.items().length <=settings.items, index=this._core.relative(this._core.current()), loop=settings.loop||settings.rewind; this._controls.$relative.toggleClass('disabled', !settings.nav||disabled); if(settings.nav){ this._controls.$previous.toggleClass('disabled', !loop&&index <=this._core.minimum(true)); this._controls.$next.toggleClass('disabled', !loop&&index >=this._core.maximum(true)); } this._controls.$absolute.toggleClass('disabled', !settings.dots||disabled); if(settings.dots){ difference=this._pages.length - this._controls.$absolute.children().length; if(settings.dotsData&&difference!==0){ this._controls.$absolute.html(this._templates.join('')); }else if(difference > 0){ this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0])); }else if(difference < 0){ this._controls.$absolute.children().slice(difference).remove(); } this._controls.$absolute.find('.active').removeClass('active'); this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active'); }}; Navigation.prototype.onTrigger=function(event){ var settings=this._core.settings; event.page={ index: $.inArray(this.current(), this._pages), count: this._pages.length, size: settings&&(settings.center||settings.autoWidth||settings.dotsData ? 1:settings.dotsEach||settings.items) };}; Navigation.prototype.current=function(){ var current=this._core.relative(this._core.current()); return $.grep(this._pages, $.proxy(function(page, index){ return page.start <=current&&page.end >=current; }, this)).pop(); }; Navigation.prototype.getPosition=function(successor){ var position, length, settings=this._core.settings; if(settings.slideBy=='page'){ position=$.inArray(this.current(), this._pages); length=this._pages.length; successor ? ++position:--position; position=this._pages[((position % length) + length) % length].start; }else{ position=this._core.relative(this._core.current()); length=this._core.items().length; successor ? position +=settings.slideBy:position -=settings.slideBy; } return position; }; Navigation.prototype.next=function(speed){ $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed); }; Navigation.prototype.prev=function(speed){ $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed); }; Navigation.prototype.to=function(position, speed, standard){ var length; if(!standard){ length=this._pages.length; $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed); }else{ $.proxy(this._overrides.to, this._core)(position, speed); }}; $.fn.vcOwlCarousel.Constructor.Plugins.Navigation=Navigation; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ 'use strict'; var Hash=function(carousel){ this._core=carousel; this._hashes={}; this.$element=this._core.$element; this._handlers={ 'initialized.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&this._core.settings.startPosition==='URLHash'){ $(window).trigger('hashchange.owl.navigation'); }}, this), 'prepared.owl.vccarousel': $.proxy(function(e){ if(e.namespace){ var hash=$(e.content).find('[data-hash]').andSelf('[data-hash]').attr('data-hash'); if(!hash){ return; } this._hashes[hash]=e.content; }}, this), 'changed.owl.vccarousel': $.proxy(function(e){ if(e.namespace&&e.property.name==='position'){ var current=this._core.items(this._core.relative(this._core.current())), hash=$.map(this._hashes, function(item, hash){ return item===current ? hash:null; }).join(); if(!hash||window.location.hash.slice(1)===hash){ return; } window.location.hash=hash; }}, this) }; this._core.options=$.extend({}, Hash.Defaults, this._core.options); this.$element.on(this._handlers); $(window).on('hashchange.owl.navigation', $.proxy(function(e){ var hash=window.location.hash.substring(1), items=this._core.$stage.children(), position=this._hashes[hash]&&items.index(this._hashes[hash]); if(position===undefined||position===this._core.current()){ return; } this._core.to(this._core.relative(position), false, true); }, this)); }; Hash.Defaults={ URLhashListener: false }; Hash.prototype.destroy=function(){ var handler, property; $(window).off('hashchange.owl.navigation'); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.vcOwlCarousel.Constructor.Plugins.Hash=Hash; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var style=$('').get(0).style, prefixes='Webkit Moz O ms'.split(' '), events={ transition: { end: { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd', transition: 'transitionend' }}, animation: { end: { WebkitAnimation: 'webkitAnimationEnd', MozAnimation: 'animationend', OAnimation: 'oAnimationEnd', animation: 'animationend' }} }, tests={ csstransforms: function(){ return !!test('transform'); }, csstransforms3d: function(){ return !!test('perspective'); }, csstransitions: function(){ return !!test('transition'); }, cssanimations: function(){ return !!test('animation'); }}; function test(property, prefixed){ var result=false, upper=property.charAt(0).toUpperCase() + property.slice(1); $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property){ if(style[property]!==undefined){ result=prefixed ? property:true; return false; }}); return result; } function prefixed(property){ return test(property, true); } if(tests.csstransitions()){ $.support.transition=new String(prefixed('transition')) $.support.transition.end=events.transition.end[ $.support.transition ]; } if(tests.cssanimations()){ $.support.animation=new String(prefixed('animation')) $.support.animation.end=events.animation.end[ $.support.animation ]; } if(tests.csstransforms()){ $.support.transform=new String(prefixed('transform')); $.support.transform3d=tests.csstransforms3d(); }})(window.Zepto||window.jQuery, window, document); (function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s}); (function(){function r(){}var n=this,t=n._,e=Array.prototype,o=Object.prototype,u=Function.prototype,i=e.push,c=e.slice,s=o.toString,a=o.hasOwnProperty,f=Array.isArray,l=Object.keys,p=u.bind,h=Object.create,v=function(n){return n instanceof v?n:this instanceof v?void(this._wrapped=n):new v(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=v),exports._=v):n._=v,v.VERSION="1.8.3";var y=function(u,i,n){if(void 0===i)return u;switch(null==n?3:n){case 1:return function(n){return u.call(i,n)};case 2:return function(n,t){return u.call(i,n,t)};case 3:return function(n,t,r){return u.call(i,n,t,r)};case 4:return function(n,t,r,e){return u.call(i,n,t,r,e)}}return function(){return u.apply(i,arguments)}},d=function(n,t,r){return null==n?v.identity:v.isFunction(n)?y(n,t,r):v.isObject(n)?v.matcher(n):v.property(n)};v.iteratee=function(n,t){return d(n,t,1/0)};function g(c,f){return function(n){var t=arguments.length;if(t<2||null==n)return n;for(var r=1;r":">",'"':""","'":"'","`":"`"},R=v.invert(T);v.escape=B(T),v.unescape=B(R),v.result=function(n,t,r){var e=null==n?void 0:n[t];return void 0===e&&(e=r),v.isFunction(e)?e.call(n):e};var q=0;v.uniqueId=function(n){var t=++q+"";return n?n+t:t},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};function K(n){return"\\"+D[n]}var z=/(.)^/,D={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\u2028|\u2029/g;v.template=function(i,n,t){!n&&t&&(n=t),n=v.defaults({},n,v.templateSettings);var r=RegExp([(n.escape||z).source,(n.interpolate||z).source,(n.evaluate||z).source].join("|")+"|$","g"),o=0,a="__p+='";i.replace(r,function(n,t,r,e,u){return a+=i.slice(o,u).replace(L,K),o=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",n.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var e=new Function(n.variable||"obj","_",a)}catch(n){throw n.source=a,n}function u(n){return e.call(this,n,v)}var c=n.variable||"obj";return u.source="function("+c+"){\n"+a+"}",u},v.chain=function(n){var t=v(n);return t._chain=!0,t};function P(n,t){return n._chain?v(t).chain():t}v.mixin=function(r){v.each(v.functions(r),function(n){var t=v[n]=r[n];v.prototype[n]=function(){var n=[this._wrapped];return i.apply(n,arguments),P(this,t.apply(v,n))}})},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];v.prototype[t]=function(){var n=this._wrapped;return r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],P(this,n)}}),v.each(["concat","join","slice"],function(n){var t=e[n];v.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return v})}).call(this); (function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this); var vcGridStyleAll; (function($){ vcGridStyleAll=function(grid){ this.grid=grid; this.settings=grid.settings; this.filterValue=null; this.$el=false; this.$content=false; this.isLoading=false; this.$loader=$('
    '); this.init(); }; vcGridStyleAll.prototype.init=function (){ _.bindAll(this , 'addItems' , 'showItems' ); }; vcGridStyleAll.prototype.render=function (){ this.$el=this.grid.$el; this.$content=this.$el; this.setIsLoading(); this.grid.ajax({}, this.addItems); }; vcGridStyleAll.prototype.setIsLoading=function (){ this.$content.append(this.$loader); this.isLoading=true; }; vcGridStyleAll.prototype.unsetIsLoading=function (){ this.isLoading=false; this.$loader&&this.$loader.remove(); }; vcGridStyleAll.prototype.filter=function(filter){ filter=_.isUndefined(filter)||'*'===filter ? '':filter; if(this.filterValue==filter){ return false; } this.$content .find('.vc_visible-item') .removeClass('vc_visible-item ' + vcGridSettings.addItemsAnimation + ' animated'); this.filterValue=filter; _.defer(this.showItems); }; vcGridStyleAll.prototype.showItems=function (){ var $els=this.$content.find('.vc_grid-item' + this.filterValue); this.setIsLoading(); $els.addClass('vc_visible-item ' + ( 'none'!==vcGridSettings.addItemsAnimation ? vcGridSettings.addItemsAnimation + ' animated':'')); this.unsetIsLoading(); jQuery(window).trigger('grid:items:added', this.$el); }; vcGridStyleAll.prototype.addItems=function(html){ this.unsetIsLoading(); $(html).appendTo(this.$el); this.$content=this.$el.find('[data-vc-grid-content="true"]'); this.grid.initFilter(); this.filter(); window.vc_prettyPhoto(); return false; };})(window.jQuery); var vcGridStyleLoadMore=null; (function($){ vcGridStyleLoadMore=function(grid){ this.grid=grid; this.settings=grid.settings; this.$loadMoreBtn=false; this.$el=false; this.filterValue=null; this.$content=false; this.isLoading=false; this.$loader=$('
    '); this.init(); }; vcGridStyleLoadMore.prototype.setIsLoading=function (){ this.$loadMoreBtn&&this.$loadMoreBtn.hide(); this.isLoading=true; }; vcGridStyleLoadMore.prototype.unsetIsLoading=function (){ this.isLoading=false; this.setLoadMoreBtn(); }; vcGridStyleLoadMore.prototype.init=function (){ _.bindAll(this , 'addItems' ); }; vcGridStyleLoadMore.prototype.render=function (){ this.$el=this.grid.$el; this.$content=this.$el; this.setIsLoading(); this.$content.append(this.$loader); this.grid.ajax({}, this.addItems); }; vcGridStyleLoadMore.prototype.showItems=function (){ var $els=this.$content.find('.vc_grid_filter-item:not(.vc_visible-item):lt(' + this.settings.items_per_page + ')'); this.setIsLoading(); $els.addClass('vc_visible-item ' + vcGridSettings.addItemsAnimation + ' animated'); this.unsetIsLoading(); jQuery(window).trigger('grid:items:added', this.$el); }; vcGridStyleLoadMore.prototype.filter=function(filter){ filter=_.isUndefined(filter)||'*'===filter ? '':filter; if(this.filterValue==filter){ return false; } this.$content.find('.vc_visible-item, .vc_grid_filter-item').removeClass('vc_visible-item vc_grid_filter-item ' +('none'!==vcGridSettings.addItemsAnimation ? vcGridSettings.addItemsAnimation + ' animated':'')); this.filterValue=filter; this.$content .find('.vc_grid-item' + this.filterValue) .addClass('vc_grid_filter-item'); this.showItems(); }; vcGridStyleLoadMore.prototype.addItems=function(html){ var els=$(html); this.$el.append(els); this.unsetIsLoading(); this.$content=els.find('[data-vc-grid-content="true"]'); this.$loadMoreBtn=els.find('[data-vc-grid-load-more-btn="true"] .vc_btn'); var self=this; this.$loadMoreBtn.click(function(e){ e.preventDefault(); self.showItems(); }); this.$loadMoreBtn.hide(); this.grid.initFilter(); this.filter(); this.$loader.remove(); window.vc_prettyPhoto(); }; vcGridStyleLoadMore.prototype.setLoadMoreBtn=function (){ if(! $('.vc_grid_filter-item:not(".vc_visible-item")', this.$content).length||! $('.vc_grid_filter-item', this.$content).length){ this.$loadMoreBtn&&this.$loadMoreBtn.hide(); }else{ this.$loadMoreBtn&&this.$loadMoreBtn.show(); }};})(window.jQuery); var vcGridStyleLazy=null; (function($){ $.waypoints('extendFn', 'vc_grid-infinite', function(options){ var $container, opts; var el=this; opts=$.extend({}, $.fn.waypoint.defaults, { container: 'auto', items: '.infinite-item', offset: 'bottom-in-view', handle: { load: function(opts){ }} }, options); $container='auto'===opts.container ? el:$(opts.container, el); opts.handler=function(direction){ var $this; if('down'===direction||'right'===direction){ $this=$(this); $this.waypoint('destroy'); opts.handle.load.call(this, opts); }}; return this.waypoint(opts); }); vcGridStyleLazy=function(grid){ this.grid=grid; this.settings=grid.settings; this.$el=false; this.filterValue=null; this.$content=false; this.isLoading=false; this.$loader=$('
    '); this.init(); }; vcGridStyleLazy.prototype.setIsLoading=function (){ this.$content.append(this.$loader); this.isLoading=true; }; vcGridStyleLazy.prototype.unsetIsLoading=function (){ this.isLoading=false; this.$loader&&this.$loader.remove(); }; vcGridStyleLazy.prototype.init=function (){ _.bindAll(this , 'addItems' , 'showItems' ); }; vcGridStyleLazy.prototype.render=function (){ this.$el=this.grid.$el; this.$content=this.$el; this.setIsLoading(); this.grid.ajax({}, this.addItems); }; vcGridStyleLazy.prototype.showItems=function (){ var $els=this.$content.find('.vc_grid_filter-item:not(.vc_visible-item):lt(' + this.settings.items_per_page + ')'); this.setIsLoading(); $els.addClass('vc_visible-item ' + vcGridSettings.addItemsAnimation + ' animated'); this.unsetIsLoading(); jQuery(window).trigger('grid:items:added', this.$el); }; vcGridStyleLazy.prototype.filter=function(filter){ filter=_.isUndefined(filter)||'*'===filter ? '':filter; if(this.filterValue==filter){ return false; } this.$content.find('.vc_visible-item, .vc_grid_filter-item').removeClass('vc_visible-item vc_grid_filter-item ' +('none'!==vcGridSettings.addItemsAnimation ? vcGridSettings.addItemsAnimation + ' animated':'')); this.filterValue=filter; this.$content .find('.vc_grid-item' + this.filterValue) .addClass('vc_grid_filter-item'); _.defer(this.showItems); this.initScroll(); }; vcGridStyleLazy.prototype.addItems=function(html){ var els=$(html); this.$el.append(els); this.unsetIsLoading(); this.$content=els.find('[data-vc-grid-content="true"]'); this.grid.initFilter(); this.filter(); window.vc_prettyPhoto(); }; vcGridStyleLazy.prototype.initScroll=function (){ var self=this; this.$content.unbind('waypoint').waypoint('vc_grid-infinite', { container: 'auto', items: '.vc_grid-item', handle: { load: function(opts){ self.showItems(); self.checkNext(opts); }} }); }; vcGridStyleLazy.prototype.checkNext=function(opts){ if(this.$content.find('.vc_grid_filter-item:not(".vc_visible-item")').length){ var fn, self=this; fn=function (){ return self.$content.waypoint(opts); }; _.defer(fn); }};})(window.jQuery); var vcGridStylePagination=null; (function($){ vcGridStylePagination=function(grid){ this.grid=grid; this.settings=grid.settings; this.$el=false; this.$content=false; this.filterValue=null; this.isLoading=false; this.htmlCache=false; this.$loader=$('
    '); this.$firstSlideItems; this.init(); }; vcGridStylePagination.prototype.init=function (){ _.bindAll(this, 'addItems', 'initCarousel' ); }; vcGridStylePagination.prototype.setIsLoading=function (){ this.$loader.show(); this.isLoading=true; }; vcGridStylePagination.prototype.unsetIsLoading=function (){ this.isLoading=false; this.$loader.hide(); }; vcGridStylePagination.prototype.render=function (){ this.$el=this.grid.$el; this.$content=this.$el; this.$content.append(this.$loader); this.setIsLoading(); this.grid.ajax({}, this.addItems); }; vcGridStylePagination.prototype.filter=function(filter){ filter=_.isUndefined(filter)||'*'===filter ? '':filter; if(this.filterValue==filter){ return false; } var $html; if(this.$content.data('owl.vccarousel')){ this.$content.off('initialized.owl.vccarousel'); this.$content.off('changed.owl.vccarousel'); this.$content.data('vcPagination')&&this.$content.data('vcPagination').twbsPagination('destroy'); this.$content.data('owl.vccarousel').destroy(); } this.$content.empty(); $html=$('.vc_grid-item', this.htmlCache); if(''!==filter){ $html=$html.filter(filter); } this.filterValue=filter; this.buildSlides($html.addClass('vc_visible-item')); }; vcGridStylePagination.prototype.buildSlides=function($html){ var i, j, tempArray, chunk=parseInt(this.settings.items_per_page); for(i=0, j=$html.length; i < j; i +=chunk){ tempArray=$html.slice(i, i + chunk); $('
    ') .append($(tempArray)) .appendTo(this.$content); } this.$content .find('.vc_pageable-slide-wrapper:first') .imagesLoaded(this.initCarousel); }; vcGridStylePagination.prototype.addItems=function(html){ this.unsetIsLoading(); $(html).appendTo(this.$el); if(false===this.htmlCache){ this.htmlCache=html; } this.$content=this.$el.find('[data-vc-pageable-content="true"]'); this.$content.addClass('owl-carousel vc_grid-owl-theme'); this.grid.initFilter(); this.filter(); window.vc_prettyPhoto(); return false; }; vcGridStylePagination.prototype.initCarousel=function (){ if($.fn.vcOwlCarousel){ var that=this, $vcCarousel; $vcCarousel=this.$content.data('owl.vccarousel'); $vcCarousel&&$vcCarousel.destroy(); this.$content.on('initialized.owl.vccarousel', function(event){ if(that.settings.paging_design.indexOf('pagination') > - 1){ var $carousel=event.relatedTarget; var items=$carousel.items().length; var $pagination=$('
    ').addClass('vc_grid-pagination').appendTo(that.$el); $pagination.twbsPagination({ totalPages: items, visiblePages: that.settings.visible_pages, onPageClick: function(event, page){ $carousel.to(page - 1); }, paginationClass: 'vc_grid-pagination-list' + ' vc_grid-' + that.settings.paging_design + ' vc_grid-pagination-color-' + that.settings.paging_color, nextClass: 'vc_grid-next', first: 20 < items ? ' ':false, last: 20 < items ? ' ':false, prev: 5 < items ? ' ':false, next: 5 < items ? ' ':false, prevClass: 'vc_grid-prev', lastClass: 'vc_grid-last', loop: that.settings.loop, firstClass: 'vc_grid-first', pageClass: 'vc_grid-page', activeClass: 'vc_grid-active', disabledClass: 'vc_grid-disabled' }); $(this).data('vcPagination', $pagination); that.$content.on('changed.owl.vccarousel', function(event){ var $pagination=$(this).data('vcPagination'), $pag_object=$pagination.data('twbsPagination'); $pag_object.render($pag_object.getPages(1 + event.page.index)); $pag_object.setupEvents(); }); window.vc_prettyPhoto(); }}).vcOwlCarousel({ items: 1, loop: this.settings.loop, margin: 10, nav: true, navText: [ '', '' ], navContainerClass: 'vc_grid-owl-nav' + ' vc_grid-owl-nav-color-' + this.settings.arrows_color, dotClass: 'vc_grid-owl-dot', dotsClass: 'vc_grid-owl-dots' + ' vc_grid-' + this.settings.paging_design + ' vc_grid-owl-dots-color-' + this.settings.paging_color, navClass: [ 'vc_grid-owl-prev' + ' ' + this.settings.arrows_design + ' vc_grid-nav-prev-' + this.settings.arrows_position, 'vc_grid-owl-next' + ' ' + this.settings.arrows_design.replace('_left', '_right') + ' vc_grid-nav-next-' + this.settings.arrows_position ], animateIn: 'none'!==this.settings.animation_in ? this.settings.animation_in:false, animateOut: 'none'!==this.settings.animation_out ? this.settings.animation_out:false, autoHeight: true, autoplay: true===this.settings.auto_play, autoplayTimeout: this.settings.speed, callbacks: true, onTranslated: function (){ setTimeout(function (){ jQuery(window).trigger('grid:items:added', that.$el); }, 750); }, onRefreshed: function (){ setTimeout(function (){ jQuery(window).trigger('grid:items:added', that.$el); }, 750); }}); }};})(window.jQuery); var VcGrid, vcGridSettings={ addItemsAnimation: 'zoomIn', mobileWindowWidth: 768, itemAnimationSpeed: 1000, itemAnimationDelay: [], clearAnimationDelays: function (){ _.each(this.itemAnimationDelay, function(id){ window.clearTimeout(id); }); this.itemAnimationDelay=[]; }}; (function($){ 'use strict'; VcGrid=function(el){ this.$el=$(el); this.settings={}; this.$filter=false; this.gridBuilder=false; this.init(); }; VcGrid.prototype.init=function (){ _.bindAll(this, 'filterItems', 'filterItemsDropdown' ); this.setSettings(); this.initStyle(); this.initHover(); this.initZoneLink(); }; VcGrid.prototype.setSettings=function (){ this.settings=$.extend({ visible_pages: 5 }, this.$el.data('vcGridSettings')||{}); }; VcGrid.prototype.initStyle=function (){ var styleObject=this.settings.style ? $.camelCase('vc-grid-style-' + this.settings.style):false; if(styleObject&&! _.isUndefined(window[ styleObject ])&&window[ styleObject ].prototype.render){ this.gridBuilder=new window[ styleObject ](this); this.gridBuilder.render(); }}; VcGrid.prototype.initFilter=function (){ this.$filter=this.$el.find('[data-vc-grid-filter]'); this.$filterDropdown=this.$el.find('[data-vc-grid-filter-select]'); this.$filter.length&&this.$filter .find('.vc_grid-filter-item') .unbind('click') .click(this.filterItems); this.$filterDropdown.length&&this.$filterDropdown .unbind('change') .change(this.filterItemsDropdown); }; VcGrid.prototype.initHover=function (){ this.$el .on('mouseover', '.vc_grid-item-mini', function (){ var $this=$(this); $this.addClass('vc_is-hover'); /* $this.find('[data-vc-animation]').each(function(){ var animation=$(this).data('vcAnimation'), animationObject='VcGridAnimation' + animation; window[animationObject]&&window[animationObject](this, 'in'); }); */ }).on('mouseleave', '.vc_grid-item-mini', function (){ var $this=$(this); $this.removeClass('vc_is-hover'); /* $this.find('[data-vc-animation]').each(function(){ var animation=$(this).data('vcAnimation'), animationObject='VcGridAnimation' + animation; window[animationObject]&&window[animationObject](this, 'out'); }); */ }); }; VcGrid.prototype.initZoneLink=function (){ if(window.vc_iframe){ this.$el.on('click.zonePostLink', '[data-vc-link]', function (){ var $this=$(this), href=$(this).data('vcLink'); window.open(href); }); this.$el.on('click', '.vc_gitem-link', function(e){ var $this=$(this); e.preventDefault(); ! $this.hasClass('vc-gitem-link-ajax')&&window.open($this.attr('href')); }); }else{ this.$el.on('click.zonePostLink', '[data-vc-link]', function (){ var $this=$(this), href=$(this).data('vcLink'); if('_blank'===$this.data('vcTarget')){ window.open(href); }else{ window.location.href=href; }}); }}; VcGrid.prototype.initHover_old=function (){ this.$el .on('mouseover', '.vc_grid-item', function (){ var $this=$(this); if($this.hasClass('vc_is-hover')){ return; } vcGridSettings.clearAnimationDelays(); $this.addClass('vc_is-hover vc_is-animated'); $this.find('.vc_grid-item-row-animate').each(function (){ var $animate=$(this), animationIn=$animate.data('animationIn'), animationOut=$animate.data('animationOut'); $animate.removeClass(animationOut).addClass(animationIn); vcGridSettings.itemAnimationDelay.push(_.delay(function (){ $animate.removeClass(animationIn); $this.removeClass('vc_is-animated'); }, vcGridSettings.itemAnimationSpeed)); }); }).on('mouseleave', '.vc_grid-item', function (){ var $this=$(this); vcGridSettings.clearAnimationDelays(); $this.addClass('vc_is-animated').removeClass('vc_is-hover'); $this.find('.vc_grid-item-row-animate').each(function (){ var $animate=$this.find('.vc_grid-item-row-animate'), animationOut=$animate.data('animationOut'), animationIn=$animate.data('animationIn'); $animate.addClass(animationOut); vcGridSettings.itemAnimationDelay.push(_.delay(function (){ $animate.removeClass(animationOut + ' ' + animationIn); $this.removeClass('vc_is-animated'); }, vcGridSettings.itemAnimationSpeed - 1)); }); }); }; VcGrid.prototype.filterItems=function(e){ var filter_method=this.style ? $.camelCase('filter-' + this.style):'filterAll', $control=$(e.currentTarget).find('[data-vc-grid-filter-value]'), filter=$control.data('vcGridFilterValue'); e&&e.preventDefault(); if($control.hasClass('vc_active')){ return false; } this.$filter.find('.vc_active').removeClass('vc_active'); this.$filterDropdown.find('.vc_active').removeClass('vc_active'); this.$filterDropdown.find('[value="' + filter + '"]').addClass('vc_active').attr('selected', 'selected'); $control.parent().addClass('vc_active'); this.gridBuilder.filter(filter); }; VcGrid.prototype.filterItemsDropdown=function(e){ var $control=this.$filterDropdown.find(':selected'), filter=$control.val(); if($control.hasClass('vc_active')){ return false; } this.$filterDropdown.find('.vc_active').removeClass('vc_active'); this.$filter.find('.vc_active').removeClass('vc_active'); this.$filter.find('[data-vc-grid-filter-value="' + filter + '"]').parent().addClass('vc_active'); $control.addClass('vc_active'); this.gridBuilder.filter(filter); }; VcGrid.prototype.ajax=function(data, callback){ var requestData; if(_.isUndefined(data)){ data={};} requestData=_.extend({ action: 'vc_get_vc_grid_data', vc_action: 'vc_get_vc_grid_data', tag: this.settings.tag, data: this.settings, vc_post_id: this.$el.data('vcPostId'), _vcnonce: this.$el.data('vcPublicNonce') }, data); $.ajax({ type: 'POST', dataType: 'html', url: this.$el.data('vcRequest'), data: requestData }).done(callback); }; function Plugin(option){ return this.each(function (){ var $this=$(this); var data=$this.data('vcGrid'); if(! data){ $this.data('vcGrid', (data=new VcGrid(this))); } if('string'===typeof(option)){ data[ option ](); }}); } $.fn.vcGrid=Plugin; $.fn.vcGrid.Constructor=VcGrid; $(document).ready(function (){ $('[data-vc-grid-settings]').vcGrid(); }); })(window.jQuery); !function(a){function b(){}function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c(a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(this),function(a){function b(a){"function"==typeof a&&(b.isReady?a():f.push(a))}function c(a){var c="readystatechange"===a.type&&"complete"!==e.readyState;if(!b.isReady&&!c){b.isReady=!0;for(var d=0,g=f.length;g>d;d++){var h=f[d];h()}}}function d(d){return d.bind(e,"DOMContentLoaded",c),d.bind(e,"readystatechange",c),d.bind(a,"load",c),b}var e=a.document,f=[];b.isReady=!1,"function"==typeof define&&define.amd?(b.isReady="function"==typeof requirejs,define("doc-ready/doc-ready",["eventie/eventie"],d)):a.docReady=d(a.eventie)}(this),function(){function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;be;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a){function b(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}function c(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=g.length;c>b;b++){var d=g[b];a[d]=0}return a}function d(a){function d(a){if("string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var d=f(a);if("none"===d.display)return c();var e={};e.width=a.offsetWidth,e.height=a.offsetHeight;for(var k=e.isBorderBox=!(!j||!d[j]||"border-box"!==d[j]),l=0,m=g.length;m>l;l++){var n=g[l],o=d[n];o=h(a,o);var p=parseFloat(o);e[n]=isNaN(p)?0:p}var q=e.paddingLeft+e.paddingRight,r=e.paddingTop+e.paddingBottom,s=e.marginLeft+e.marginRight,t=e.marginTop+e.marginBottom,u=e.borderLeftWidth+e.borderRightWidth,v=e.borderTopWidth+e.borderBottomWidth,w=k&&i,x=b(d.width);x!==!1&&(e.width=x+(w?0:q+u));var y=b(d.height);return y!==!1&&(e.height=y+(w?0:r+v)),e.innerWidth=e.width-(q+u),e.innerHeight=e.height-(r+v),e.outerWidth=e.width+s,e.outerHeight=e.height+t,e}}function h(a,b){if(e||-1===b.indexOf("%"))return b;var c=a.style,d=c.left,f=a.runtimeStyle,g=f&&f.left;return g&&(f.left=a.currentStyle.left),c.left=b,b=c.pixelLeft,c.left=d,g&&(f.left=g),b}var i,j=a("boxSizing");return function(){if(j){var a=document.createElement("div");a.style.width="200px",a.style.padding="1px 2px 3px 4px",a.style.borderStyle="solid",a.style.borderWidth="1px 2px 3px 4px",a.style[j]="border-box";var c=document.body||document.documentElement;c.appendChild(a);var d=f(a);i=200===b(d.width),c.removeChild(a)}}(),d}var e=a.getComputedStyle,f=e?function(a){return e(a,null)}:function(a){return a.currentStyle},g=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],d):"object"==typeof exports?module.exports=d(require("get-style-property")):a.getSize=d(a.getStyleProperty)}(window),function(a,b){function c(a,b){return a[h](b)}function d(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}function e(a,b){d(a);for(var c=a.parentNode.querySelectorAll(b),e=0,f=c.length;f>e;e++)if(c[e]===a)return!0;return!1}function f(a,b){return d(a),c(a,b)}var g,h=function(){if(b.matchesSelector)return"matchesSelector";for(var a=["webkit","moz","ms","o"],c=0,d=a.length;d>c;c++){var e=a[c],f=e+"MatchesSelector";if(b[f])return f}}();if(h){var i=document.createElement("div"),j=c(i,"div");g=j?c:f}else g=e;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return g}):window.matchesSelector=g}(this,Element.prototype),function(a){function b(a,b){for(var c in b)a[c]=b[c];return a}function c(a){for(var b in a)return!1;return b=null,!0}function d(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function e(a,e,f){function h(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}var i=f("transition"),j=f("transform"),k=i&&j,l=!!f("perspective"),m={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[i],n=["transform","transition","transitionDuration","transitionProperty"],o=function(){for(var a={},b=0,c=n.length;c>b;b++){var d=n[b],e=f(d);e&&e!==d&&(a[d]=e)}return a}();b(h.prototype,a.prototype),h.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},h.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},h.prototype.getSize=function(){this.size=e(this.element)},h.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=o[c]||c;b[d]=a[c]}},h.prototype.getPosition=function(){var a=g(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=parseInt(a[c?"left":"right"],10),f=parseInt(a[d?"top":"bottom"],10);e=isNaN(e)?0:e,f=isNaN(f)?0:f;var h=this.layout.size;e-=c?h.paddingLeft:h.paddingRight,f-=d?h.paddingTop:h.paddingBottom,this.position.x=e,this.position.y=f},h.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={};b.isOriginLeft?(c.left=this.position.x+a.paddingLeft+"px",c.right=""):(c.right=this.position.x+a.paddingRight+"px",c.left=""),b.isOriginTop?(c.top=this.position.y+a.paddingTop+"px",c.bottom=""):(c.bottom=this.position.y+a.paddingBottom+"px",c.top=""),this.css(c),this.emitEvent("layout",[this])};var p=l?function(a,b){return"translate3d("+a+"px, "+b+"px, 0)"}:function(a,b){return"translate("+a+"px, "+b+"px)"};h.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={},k=this.layout.options;h=k.isOriginLeft?h:-h,i=k.isOriginTop?i:-i,j.transform=p(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},h.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},h.prototype.moveTo=k?h.prototype._transitionTo:h.prototype.goTo,h.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},h.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},h.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var q=j&&d(j)+",opacity";h.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:q,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(m,this,!1))},h.prototype.transition=h.prototype[i?"_transition":"_nonTransition"],h.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},h.prototype.onotransitionend=function(a){this.ontransitionend(a)};var r={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};h.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,d=r[a.propertyName]||a.propertyName;if(delete b.ingProperties[d],c(b.ingProperties)&&this.disableTransition(),d in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[d]),d in b.onEnd){var e=b.onEnd[d];e.call(this),delete b.onEnd[d]}this.emitEvent("transitionEnd",[this])}},h.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(m,this,!1),this.isTransitioning=!1},h.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var s={transitionProperty:"",transitionDuration:""};return h.prototype.removeTransitionStyles=function(){this.css(s)},h.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},h.prototype.remove=function(){if(!i||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.on("transitionEnd",function(){return a.removeElem(),!0}),this.hide()},h.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options;this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0})},h.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options;this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:{opacity:function(){this.isHidden&&this.css({display:"none"})}}})},h.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},h}var f=a.getComputedStyle,g=f?function(a){return f(a,null)}:function(a){return a.currentStyle};"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],e):(a.Outlayer={},a.Outlayer.Item=e(a.EventEmitter,a.getSize,a.getStyleProperty))}(window),function(a){function b(a,b){for(var c in b)a[c]=b[c];return a}function c(a){return"[object Array]"===l.call(a)}function d(a){var b=[];if(c(a))b=a;else if(a&&"number"==typeof a.length)for(var d=0,e=a.length;e>d;d++)b.push(a[d]);else b.push(a);return b}function e(a,b){var c=n(b,a);-1!==c&&b.splice(c,1)}function f(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()}function g(c,g,l,n,o,p){function q(a,c){if("string"==typeof a&&(a=h.querySelector(a)),!a||!m(a))return void(i&&i.error("Bad "+this.constructor.namespace+" element: "+a));this.element=a,this.options=b({},this.constructor.defaults),this.option(c);var d=++r;this.element.outlayerGUID=d,s[d]=this,this._create(),this.options.isInitLayout&&this.layout()}var r=0,s={};return q.namespace="outlayer",q.Item=p,q.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},b(q.prototype,l.prototype),q.prototype.option=function(a){b(this.options,a)},q.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),b(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},q.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},q.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}return d},q.prototype._filterFindItemElements=function(a){a=d(a);for(var b=this.options.itemSelector,c=[],e=0,f=a.length;f>e;e++){var g=a[e];if(m(g))if(b){o(g,b)&&c.push(g);for(var h=g.querySelectorAll(b),i=0,j=h.length;j>i;i++)c.push(h[i])}else c.push(g)}return c},q.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},q.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},q.prototype._init=q.prototype.layout,q.prototype._resetLayout=function(){this.getSize()},q.prototype.getSize=function(){this.size=n(this.element)},q.prototype._getMeasurement=function(a,b){var c,d=this.options[a];d?("string"==typeof d?c=this.element.querySelector(d):m(d)&&(c=d),this[a]=c?n(c)[b]:d):this[a]=0},q.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},q.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}return b},q.prototype._layoutItems=function(a,b){function c(){d.emitEvent("layoutComplete",[d,a])}var d=this;if(!a||!a.length)return void c();this._itemsOn(a,"layout",c);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f],i=this._getItemLayoutPosition(h);i.item=h,i.isInstant=b||h.isLayoutInstant,e.push(i)}this._processLayoutQueue(e)},q.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},q.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},q.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},q.prototype._postLayout=function(){this.resizeContainer()},q.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},q.prototype._getContainerSize=k,q.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},q.prototype._itemsOn=function(a,b,c){function d(){return e++,e===f&&c.call(g),!0}for(var e=0,f=a.length,g=this,h=0,i=a.length;i>h;h++){var j=a[h];j.on(b,d)}},q.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},q.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored},q.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},q.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e(d,this.stamps),this.unignore(d)}},q.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=d(a)):void 0},q.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},q.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},q.prototype._manageStamp=k,q.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,d=n(a),e={left:b.left-c.left-d.marginLeft,top:b.top-c.top-d.marginTop,right:c.right-b.right-d.marginRight,bottom:c.bottom-b.bottom-d.marginBottom};return e},q.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},q.prototype.bindResize=function(){this.isResizeBound||(c.bind(a,"resize",this),this.isResizeBound=!0)},q.prototype.unbindResize=function(){this.isResizeBound&&c.unbind(a,"resize",this),this.isResizeBound=!1},q.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},q.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},q.prototype.needsResizeLayout=function(){var a=n(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},q.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},q.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},q.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},q.prototype.reveal=function(a){var b=a&&a.length;if(b)for(var c=0;b>c;c++){var d=a[c];d.reveal()}},q.prototype.hide=function(a){var b=a&&a.length;if(b)for(var c=0;b>c;c++){var d=a[c];d.hide()}},q.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},q.prototype.getItems=function(a){if(a&&a.length){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c],f=this.getItem(e);f&&b.push(f)}return b}},q.prototype.remove=function(a){a=d(a);var b=this.getItems(a);if(b&&b.length){this._itemsOn(b,"remove",function(){this.emitEvent("removeComplete",[this,b])});for(var c=0,f=b.length;f>c;c++){var g=b[c];g.remove(),e(g,this.items)}}},q.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}this.unbindResize(),delete this.element.outlayerGUID,j&&j.removeData(this.element,this.constructor.namespace)},q.data=function(a){var b=a&&a.outlayerGUID;return b&&s[b]},q.create=function(a,c){function d(){q.apply(this,arguments)}return Object.create?d.prototype=Object.create(q.prototype):b(d.prototype,q.prototype),d.prototype.constructor=d,d.defaults=b({},q.defaults),b(d.defaults,c),d.prototype.settings={},d.namespace=a,d.data=q.data,d.Item=function(){p.apply(this,arguments)},d.Item.prototype=new p,g(function(){for(var b=f(a),c=h.querySelectorAll(".js-"+b),e="data-"+b+"-options",g=0,k=c.length;k>g;g++){var l,m=c[g],n=m.getAttribute(e);try{l=n&&JSON.parse(n)}catch(o){i&&i.error("Error parsing "+e+" on "+m.nodeName.toLowerCase()+(m.id?"#"+m.id:"")+": "+o);continue}var p=new d(m,l);j&&j.data(m,a,p)}}),j&&j.bridget&&j.bridget(a,d),d},q.Item=p,q}var h=a.document,i=a.console,j=a.jQuery,k=function(){},l=Object.prototype.toString,m="object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName},n=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1};"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],g):a.Outlayer=g(a.eventie,a.docReady,a.EventEmitter,a.getSize,a.matchesSelector,a.Outlayer.Item)}(window),function(a){function b(a,b){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d}var c=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++){var e=a[c];if(e===b)return c}return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],b):a.Masonry=b(a.Outlayer,a.getSize)}(window); var vcGridStyleAllMasonry; (function($){ vcGridStyleAllMasonry=function(grid){ this.grid=grid; this.settings=grid.settings; this.filterValue=null; this.$el=false; this.$content=false; this.isLoading=false; this.filtered=false; this.$loader=$('
    '); this.masonryEnabled=false; _.bindAll(this, 'setMasonry'); this.init(); }; vcGridStyleAllMasonry.prototype=_.extend({}, vcGridStyleAll.prototype, { showItems: function (){ var $els=this.$content.find('.vc_grid-item' + this.filterValue); var self=this; this.setIsLoading(); $els.imagesLoaded(function (){ $els.addClass('vc_visible-item'); self.setItems($els); if(self.filtered){ self.filtered=false; self.setMasonry(); } self.unsetIsLoading(); window.vc_prettyPhoto(); jQuery(window).trigger('grid:items:added', self.$el); }); }, filter: function(filter){ filter=_.isUndefined(filter)||'*'===filter ? '':filter; if(this.filterValue==filter){ return false; } this.filterValue=filter; this.$content.data('masonry')&&this.$content.masonry('destroy'); this.masonryEnabled=false; this.$content .find('.vc_visible-item') .removeClass('vc_visible-item'); this.$content .find('.vc_grid-item' + this.filterValue); this.filtered=true; $(window).resize(this.setMasonry); this.setMasonry(); this.showItems(); }, setIsLoading: function (){ this.$el.append(this.$loader); this.isLoading=true; }, unsetIsLoading: function (){ this.isLoading=false; this.$loader&&this.$loader.remove(); }, setItems: function(els){ if(this.masonryEnabled){ this.$content.masonry('appended', els); }else{ this.setMasonry(); }}, setMasonry: function (){ var windowWidth=window.innerWidth; if(windowWidth < vcGridSettings.mobileWindowWidth){ this.$content.data('masonry')&&this.$content.masonry('destroy'); this.masonryEnabled=false; }else if(this.masonryEnabled){ this.$content.masonry('reloadItems'); this.$content.masonry('layout'); }else{ this.$content.masonry({ itemSelector: ".vc_visible-item", isResizeBound: false }); this.masonryEnabled=true; }} }); })(window.jQuery); var vcGridStyleLazyMasonry; (function($){ vcGridStyleLazyMasonry=function(grid){ this.grid=grid; this.settings=grid.settings; this.$el=false; this.filterValue=null; this.filtered=false; this.$content=false; this.isLoading=false; this.$loader=$('
    '); this.masonryEnabled=false; _.bindAll(this, 'setMasonry'); this.init(); }; vcGridStyleLazyMasonry.prototype=_.extend({}, vcGridStyleLazy.prototype, { showItems: function (){ if(true===this.isLoading){ return false; } this.setIsLoading(); var $els=this.$content.find('.vc_grid_filter-item:not(.vc_visible-item):lt(' + this.settings.items_per_page + ')'); var self=this; $els.imagesLoaded(function (){ $els.addClass('vc_visible-item'); self.setItems($els); if(self.filtered){ self.filtered=false; self.setMasonry(); self.initScroll(); window.vc_prettyPhoto(); } self.unsetIsLoading(); jQuery(window).trigger('grid:items:added', self.$el); }); }, setIsLoading: function (){ this.$el.append(this.$loader); this.isLoading=true; }, filter: function(filter){ filter=_.isUndefined(filter)||'*'===filter ? '':filter; if(this.filterValue==filter){ return false; } this.$content.data('masonry')&&this.$content.masonry('destroy'); this.masonryEnabled=false; this.$content.find('.vc_visible-item, .vc_grid_filter-item').removeClass('vc_visible-item vc_grid_filter-item ' +('none'!==vcGridSettings.addItemsAnimation ? vcGridSettings.addItemsAnimation + ' animated':'')); this.filterValue=filter; this.$content .find('.vc_grid-item' + this.filterValue) .addClass('vc_grid_filter-item'); this.filtered=true; $(window).resize(this.setMasonry); this.setMasonry(); _.defer(this.showItems); }, setItems: function(els){ if(this.masonryEnabled){ this.$content.masonry('appended', els); }else{ this.setMasonry(); }}, setMasonry: function (){ var windowWidth=window.innerWidth; if(windowWidth < vcGridSettings.mobileWindowWidth){ this.$content.data('masonry')&&this.$content.masonry('destroy'); this.masonryEnabled=false; }else if(this.masonryEnabled){ this.$content.masonry('reloadItems'); this.$content.masonry('layout'); }else{ this.$content.masonry({ itemSelector: ".vc_visible-item", isResizeBound: false }); this.masonryEnabled=true; }} }); })(window.jQuery); var vcGridStyleLoadMoreMasonry; (function($){ vcGridStyleLoadMoreMasonry=function(grid){ this.grid=grid; this.settings=grid.settings; this.$loadMoreBtn=false; this.$el=false; this.filterValue=null; this.$content=false; this.isLoading=false; this.filtered=false; this.$loader=$('
    '); this.masonryEnabled=false; _.bindAll(this, 'setMasonry'); this.init(); }; vcGridStyleLoadMoreMasonry.prototype=_.extend({}, vcGridStyleLoadMore.prototype, { showItems: function (){ if(true===this.isLoading){ return false; } this.setIsLoading(); var $els=this.$content.find('.vc_grid_filter-item:not(.vc_visible-item):lt(' + this.settings.items_per_page + ')'); var self=this; $els.imagesLoaded(function (){ $els.addClass('vc_visible-item'); self.setItems($els); if(self.filtered){ self.filtered=false; self.setMasonry(); window.vc_prettyPhoto(); } self.unsetIsLoading(); jQuery(window).trigger('grid:items:added', self.$el); }); }, filter: function(filter){ filter=_.isUndefined(filter)||'*'===filter ? '':filter; if(this.filterValue==filter){ return false; } this.$content.data('masonry')&&this.$content.masonry('destroy'); this.masonryEnabled=false; this.$content.find('.vc_visible-item, .vc_grid_filter-item').removeClass('vc_visible-item vc_grid_filter-item ' +('none'!==vcGridSettings.addItemsAnimation ? vcGridSettings.addItemsAnimation + ' animated':'')); this.filterValue=filter; this.$content .find('.vc_grid-item' + this.filterValue) .addClass('vc_grid_filter-item'); this.filtered=true; $(window).resize(this.setMasonry); this.setMasonry(); this.showItems(); }, setIsLoading: function (){ this.$el.append(this.$loader); this.$loadMoreBtn&&this.$loadMoreBtn.hide(); this.isLoading=true; }, unsetIsLoading: function (){ this.isLoading=false; this.$loader&&this.$loader.remove(); this.setLoadMoreBtn(); }, setItems: function(els){ if(this.masonryEnabled){ this.$content.masonry('appended', els); }else{ this.setMasonry(); }}, setMasonry: function (){ var windowWidth=window.innerWidth; if(windowWidth < vcGridSettings.mobileWindowWidth){ this.$content.data('masonry')&&this.$content.masonry('destroy'); this.masonryEnabled=false; }else if(this.masonryEnabled){ this.$content.masonry('reloadItems'); this.$content.masonry('layout'); }else{ this.$content.masonry({ itemSelector: ".vc_visible-item", isResizeBound: false }); this.masonryEnabled=true; }} }); })(window.jQuery);